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.

Showing 1-3 of 3 results.

A240752 First differences of digit sums of squares, cf. A004159.

Original entry on oeis.org

1, 3, 5, -2, 0, 2, 4, -3, -1, -8, 3, 5, 7, 0, -7, 4, 6, -10, 1, -6, 5, 7, 0, 2, -5, 6, -1, 1, -6, -4, 7, -9, 11, -5, -3, 8, 1, -6, -4, -2, 9, 2, 4, -3, -10, 1, 3, -4, -2, 0, 2, 4, 6, -1, -8, 3, 5, -2, 0, -7, 4, 6, 8, -8, -6, 5, 7, -9, 2, -5, -3, 8, 1, 3, -4
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 12 2014

Keywords

Crossrefs

Programs

  • Haskell
    a240752 n = a240752_list !! (n-1)
    a240752_list = zipWith (-) (tail a004159_list) a004159_list
    
  • Mathematica
    Differences[Total[IntegerDigits[#]]&/@(Range[0,80]^2)] (* Harvey P. Dale, Mar 10 2019 *)
  • PARI
    a(n) = sumdigits(n^2) - sumdigits((n-1)^2); \\ Michel Marcus, Jan 24 2022
    
  • Python
    def A240752(n): return sum(map(int,str(m:=n**2)))-sum(map(int,str(m-(n<<1)+1))) # Chai Wah Wu, Mar 15 2023

Formula

a(n) = A004159(n) - A004159(n-1).
a(n) = A007953(A000290(n)) - A007953(A000290(n-1)).
a(A202089(n)+1) = 0; a(A239878(n)+1) = 1; a(A240754(n)+1) = -1.

Extensions

Formulas adapted to offset by Michel Marcus, Jan 25 2022

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

A240754 Numbers k with digit_sum(k*k) - 1 = digit_sum((k+1)*(k+1)).

Original entry on oeis.org

8, 26, 53, 98, 107, 143, 161, 170, 179, 188, 224, 233, 242, 260, 269, 278, 287, 296, 350, 368, 386, 404, 413, 431, 449, 476, 494, 503, 539, 548, 557, 584, 593, 629, 638, 647, 674, 683, 737, 746, 773, 791, 818, 827, 863, 872, 908, 926, 944, 998, 1007, 1043
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 12 2014

Keywords

Comments

A240752(a(n)) = 0.

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a240754 n = a240754_list !! (n-1)
    a240754_list = elemIndices (-1) a240752_list
    
  • Python
    def ds(n): return sum(map(int, str(n)))
    def ok(n): return ds(n*n) - 1 == ds((n+1)*(n+1))
    print(list(filter(ok, range(1044)))) # Michael S. Branicky, Aug 26 2021
Showing 1-3 of 3 results.