cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A239878 Numbers k with digit_sum(k*k) + 1 = digit_sum((k+1)*(k+1)).

Original entry on oeis.org

0, 18, 27, 36, 45, 72, 81, 108, 153, 198, 216, 225, 243, 252, 270, 297, 306, 342, 369, 396, 423, 441, 450, 477, 486, 495, 504, 513, 522, 549, 558, 576, 603, 630, 639, 657, 693, 702, 729, 747, 756, 783, 801, 846, 891, 918, 954, 963, 972, 981
Offset: 1

Views

Author

Reiner Moewald, Mar 28 2014

Keywords

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

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a239878 n = a239878_list !! (n-1)
    a239878_list = elemIndices 1 a240752_list
    -- Reinhard Zumkeller, Apr 12 2014
  • PARI
    isok(n) = (sumdigits(n^2) + 1) == sumdigits((n+1)^2); \\ Michel Marcus, Apr 06 2014
    
  • 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(count,"   ",i)
    

Formula

A240752(a(n)) = 1. - Reinhard Zumkeller, Apr 12 2014