5 deleted 2 characters in body
source | link
Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:If B=Ans:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
                 ; (result is in Ans)
If B=Ans         ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans    ;prgmA

                      seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                        ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list
Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:If B=Ans:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
                 ; (result is in Ans)
If B=Ans         ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans    ;prgmA

                      seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                        ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list
Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:If B=Ans:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
                 ; (result is in Ans)
If B=Ans         ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans   ;prgmA

                      seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                       ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list
4 Golfed the code. Reduced byte count by 4.
source | link

TI-BASIC 47 + 19 = 6666 62 bytes

Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:Ans→C:If B=CB=Ans:IS>(X,N:End:A
sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans
Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:Ans→C:If B=CB=Ans:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
Ans→C            ;store the result of the helper; program(result is in CAns)
If B=C  B=Ans         ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans    ;prgmA

                      seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                        ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list

TI-BASIC 47 + 19 = 66 bytes

Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:Ans→C:If B=C:IS>(X,N:End:A
sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans
Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:Ans→C:If B=C:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
Ans→C            ;store the result of the helper program in C
If B=C           ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans    ;prgmA

                      seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                        ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list

TI-BASIC 66 62 bytes

Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:If B=Ans:IS>(X,N:End:A
sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans
Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:If B=Ans:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
                 ; (result is in Ans)
If B=Ans         ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans    ;prgmA

                      seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                        ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list
3 Added byte count and fixed explanation.
source | link

(Byte count to be evaluated when I have time.)

Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:Ans→C:If B=C:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
Ans→C            ;store the result of the helper program in C
If B=C           ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans    ;prgmA

                       seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                        ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list

(Byte count to be evaluated when I have time.)

Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:Ans→C:If B=C:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
Ans→C            ;store the result of the helper program in C
If B=C           ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans   ;prgmA

                       seq(⁻X-1,X,0,log(Ans   ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                       ;raise 10 to the power of each element
                Ans                           ;multiply by the input
          fPart(                              ;remove the integer part
        10                                    ;multiply by 10
    int(                                      ;round to the nearest integer
sum(                                          ;then sum the resulting list
Ans→N:While X<N:IS>(A,A::A:prgmA:Ans→B:A²:prgmA:Ans→C:If B=C:IS>(X,N:End:A ;prgmCDGF1E

Ans→N            ;store the input in N
While X<N        ;loop until the Nth term has been reached
IS>(A,A:         ;add 1 to A
                 ; (Increment A and skip the next statement if A>A)
A                ;leave A in Ans
prgmA            ;call the helper program below
Ans→B            ;store the result of the helper program in B
A²               ;square A and leave the result in Ans
prgmA            ;call the helper program below
Ans→C            ;store the result of the helper program in C
If B=C           ;if the two results are equal
IS>(X,N          ;add 1 to X
                 ; (Increment X and skip the next statement if X>N)
End
A                ;leave A in Ans
                 ;implicit print of Ans

sum(int(10fPart(Ans₁₀^(seq(⁻X-1,X,0,log(Ans    ;prgmA

                      seq(⁻X-1,X,0,log(Ans    ;generate a list...
                                              ; using X as the variable,
                                              ; starting at 0,
                                              ; ending at the log of Ans,
                                              ; and evaluating "⁻X-1" for each element
                                              ; (implicit increment of 1)
                   ₁₀^(                        ;raise 10 to the power of each element
                Ans                           ;multiply each element by the input
          fPart(                              ;remove the integer part from each element
        10                                    ;multiply each element by 10
    int(                                      ;round each element to the nearest integer
sum(                                          ;then sum the resulting list
2 Added byte count and fixed explanation.
source | link
1
source | link