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-4 of 4 results.

A192686 Record values in A048377.

Original entry on oeis.org

11, 222, 3333, 44444, 555555, 6666666, 77777777, 888888888, 9999999999, 11888888888, 119999999999, 222888888888, 2229999999999, 3333888888888, 33339999999999, 44444888888888, 444449999999999, 555555888888888, 5555559999999999, 6666666888888888
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 10 2011

Keywords

Comments

a(n) = A048377(A067043(n)).

A003132 Sum of squares of digits of n.

Original entry on oeis.org

0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 1, 2, 5, 10, 17, 26, 37, 50, 65, 82, 4, 5, 8, 13, 20, 29, 40, 53, 68, 85, 9, 10, 13, 18, 25, 34, 45, 58, 73, 90, 16, 17, 20, 25, 32, 41, 52, 65, 80, 97, 25, 26, 29, 34, 41, 50, 61, 74, 89, 106, 36, 37, 40, 45, 52, 61, 72, 85, 100, 117, 49
Offset: 0

Views

Author

Keywords

Comments

It is easy to show that a(n) < 81*(log_10(n)+1). - Stefan Steinerberger, Mar 25 2006
It is known that a(0)=0 and a(1)=1 are the only fixed points of this map. For more information about iterations of this map, see A007770, A099645 and A000216 ff. - M. F. Hasler, May 24 2009
Also known as the "Happy number map", since happy numbers A007770 are those whose trajectory under iterations of this map ends at 1. - M. F. Hasler, Jun 03 2025

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Hugo Steinhaus, One Hundred Problems in Elementary Mathematics, Dover New York, 1979, republication of English translation of Sto Zadań, Basic Books, New York, 1964. Chapter I.2, An interesting property of numbers, pp. 11-12 (available on Google Books).

Crossrefs

Concerning iterations of this map, see A003621, A039943, A099645, A031176, A007770, A000216 (starting with 2), A000218 (starting with 3), A080709 (starting with 4, this is the only nontrivial limit cycle), A000221 (starting with 5), A008460 (starting with 6), A008462 (starting with 8), A008463 (starting with 9), A139566 (starting with 15), A122065 (starting with 74169). - M. F. Hasler, May 24 2009
Cf. A080151, A051885 (record values and where they occur).

Programs

  • Haskell
    a003132 0 = 0
    a003132 x = d ^ 2 + a003132 x' where (x', d) = divMod x 10
    -- Reinhard Zumkeller, May 10 2015, Aug 07 2012, Jul 10 2011
    
  • Magma
    [0] cat [&+[d^2: d in Intseq(n)]: n in [1..80]]; // Bruno Berselli, Feb 01 2013
    
  • Maple
    A003132 := proc(n) local d; add(d^2,d=convert(n,base,10)) ; end proc: # R. J. Mathar, Oct 16 2010
  • Mathematica
    Table[Sum[DigitCount[n][[i]]*i^2, {i, 1, 9}], {n, 0, 40}] (* Stefan Steinerberger, Mar 25 2006 *)
    Total/@(IntegerDigits[Range[0,80]]^2) (* Harvey P. Dale, Jun 20 2011 *)
  • PARI
    A003132(n)=norml2(digits(n)) \\ M. F. Hasler, May 24 2009, updated Apr 12 2015
    
  • Python
    def A003132(n): return sum(int(d)**2 for d in str(n)) # Chai Wah Wu, Apr 02 2021

Formula

a(n) = n^2 - 20*n*floor(n/10) + 81*(Sum_{k>0} floor(n/10^k)^2) + 20*Sum_{k>0} floor(n/10^k)*(floor(n/10^k) - floor(n/10^(k+1))). - Hieronymus Fischer, Jun 17 2007
a(10n+k) = a(n)+k^2, 0 <= k < 10. - Hieronymus Fischer, Jun 17 2007
a(n) = A007953(A048377(n)) - A007953(n). - Reinhard Zumkeller, Jul 10 2011

Extensions

More terms from Stefan Steinerberger, Mar 25 2006
Terms checked using the given PARI code, M. F. Hasler, May 24 2009
Replaced the Maple program with a version which works also for arguments with >2 digits, R. J. Mathar, Oct 16 2010
Added ref to Porges. Steinhaus also treated iterations of this function in his Polish book Sto zadań, but I don't have access to it. - Don Knuth, Sep 07 2015

A048376 Replace each 1 in decimal expansion of n with 1 1's, each 2 with 2 2's, etc. (0 vanishes).

Original entry on oeis.org

1, 22, 333, 4444, 55555, 666666, 7777777, 88888888, 999999999, 1, 11, 122, 1333, 14444, 155555, 1666666, 17777777, 188888888, 1999999999, 22, 221, 2222, 22333, 224444, 2255555, 22666666, 227777777, 2288888888, 22999999999, 333, 3331
Offset: 1

Views

Author

Patrick De Geest, Mar 15 1999

Keywords

Examples

			12 -> 122, 123->122333.
		

Crossrefs

Programs

  • Mathematica
    With[{rules=Table[n->Table[n,{n}],{n,0,9}]},Table[FromDigits[ Flatten[ IntegerDigits[x]/.rules]],{x,40}]] (* Harvey P. Dale, Oct 09 2011 *)
  • PARI
    A048376(n)={sum(i=1,#n=concat( apply( t->vector(t,i,t),digits(n) )),n[i]*10^(#n-i))} \\ M. F. Hasler, Jan 23 2013

A067043 Nondecreasing sums of digits: a(0) = 0 and for n>0: a(n) = Min{m>n|SumOfDigits(m)>= SumOfDigits(a(n-1))}, where SumOfDigits = A007953.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 19, 28, 29, 38, 39, 48, 49, 58, 59, 68, 69, 78, 79, 88, 89, 98, 99, 189, 198, 199, 289, 298, 299, 389, 398, 399, 489, 498, 499, 589, 598, 599, 689, 698, 699, 789, 798, 799, 889, 898, 899, 989, 998
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 17 2002

Keywords

Comments

A138472(a(n)) = 0. - Reinhard Zumkeller, Mar 19 2008
Positions of records in A048377: A192686(n) = A048377(a(n)). [Reinhard Zumkeller, Jul 10 2011]

Crossrefs

Programs

  • Haskell
    a067043 n = a067043_list !! n
    a067043_list = 0 : f 1 1 0 1 where
       f k x y z
         | y > 0     = (x-y) : f k x (y `div` 10) z
         | k < 9     = x : f (k+1) (2*x-k*z+1) (z `div` 10) z
         | otherwise = x : f 1 (20*z-1) z (10*z)
    -- Reinhard Zumkeller, Jul 10 2011
Showing 1-4 of 4 results.