OFFSET
1,2
COMMENTS
All terms are divisible by 9.
The number of terms is unlimited: n = 3*10^z + 6, i.e., digit_sum(n*n) + 1 = 27 + 1 = 28 = digit_sum((n+1)*(n+1)). - Reiner Moewald, Apr 20 2014
LINKS
Reiner Moewald, Table of n, a(n) for n = 1..4067
FORMULA
A240752(a(n)) = 1. - Reinhard Zumkeller, Apr 12 2014
PROG
(Python)
def digit_Sum(n):
...integerString = str(n)
...digit_Sum=0
...for digitLetter in integerString:
......digit_Sum = digit_Sum + int(digitLetter)
...return digit_Sum
count = 0;
for i in range(20000):
...if(digit_Sum(i*i) + 1 == digit_Sum((i+1)*(i+1))):
......count = count +1
......print(anz, " ", i);
(PARI) isok(n) = (sumdigits(n^2) + 1) == sumdigits((n+1)^2); \\ Michel Marcus, Apr 06 2014
(Haskell)
import Data.List (elemIndices)
a239878 n = a239878_list !! (n-1)
a239878_list = elemIndices 1 a240752_list
-- Reinhard Zumkeller, Apr 12 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reiner Moewald, Mar 28 2014
STATUS
approved