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

A074784 a(n) = a(n-1) + square of the sum of digits of n.

Original entry on oeis.org

0, 1, 5, 14, 30, 55, 91, 140, 204, 285, 286, 290, 299, 315, 340, 376, 425, 489, 570, 670, 674, 683, 699, 724, 760, 809, 873, 954, 1054, 1175, 1184, 1200, 1225, 1261, 1310, 1374, 1455, 1555, 1676, 1820, 1836, 1861, 1897, 1946, 2010, 2091, 2191, 2312, 2456
Offset: 0

Views

Author

Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002

Keywords

Comments

a(n) = Sum_{i=0..n} digsum(i)^2, where digsum(i) = A007953(i). - N. J. A. Sloane, Nov 13 2013

Crossrefs

Partial sums of A118881.

Programs

  • Magma
    [n eq 1 select n else Self(n-1)+(&+Intseq(n))^2: n in [1..48]];  // Bruno Berselli, Jul 12 2011
  • Maple
    See A037123.
  • Mathematica
    Accumulate @ Array[(Plus @@ IntegerDigits[#])^2 &, 50] (* Amiram Eldar, Jan 20 2022 *)

Formula

a(n) = Sum_{k=1..n} s(k)^2 = Sum_{k=1..n} A007953(k)^2, where s(k) denotes the sum of the digits of k in decimal representation.
Asymptotic expression: a(n-1) = Sum_{k=1..n-1} s(k)^2 = 20.25*n*log_10(n)^2 + O(n*log_10(n)).
In general: Sum_{k=1..n-1} s(k)^m = n*((9/2)*log_10(n))^m + O(n*log_10(n)^(m-1)).

Extensions

Offset changed to 0 and a(0) prepended by Amiram Eldar, Jan 20 2022

A177148 a(n) = number of squares of summations of digits before reaching the end of the cycle.

Original entry on oeis.org

0, 0, 5, 2, 4, 4, 2, 3, 3, 1, 1, 5, 2, 4, 4, 2, 3, 3, 1, 2, 5, 2, 4, 4, 2, 3, 3, 1, 2, 5, 2, 4, 4, 2, 3, 3, 1, 2, 5, 2, 4, 4, 2, 3, 3, 1, 2, 5, 2, 2, 4, 2, 3, 3, 1, 2, 5, 2, 2, 3, 2, 3, 3, 1, 2, 5, 2, 2, 3, 2, 3, 3, 1, 2, 5, 2, 2, 3, 2, 2, 3, 1, 2, 5, 2, 2, 3, 2, 2, 4, 1, 2, 5, 2, 2, 3, 2, 2, 4, 2, 1, 5, 2, 4, 4
Offset: 0

Views

Author

Michel Lagneau, May 03 2010

Keywords

Comments

a(n) is the number of times you form the square of the sum of the digits before reaching the last number of the cycle. According to the computations with Maple program, this last number belong to the set {1,81,100,169,256}, and a(n) < = 5.
Example : 4 -> 16 -> (1+6)^2 = 49 -> (4+9)^2 = 169 -> (1+6+9)^2 = 256, and 256 is the last number of the list because 256 -> (2+5+6)^2 = 169 belong to the list.

Examples

			0 is in the sequence twice because 0->0 and 1 -> 1 ;
5 is in the sequence because : 5 -> 25 -> 49 -> 169 -> 256, last number because 256 -> 169.
		

Crossrefs

Cf. A118881.

Programs

  • Maple
    A177148 := proc(n)
            local traj ,a,m,c;
            traj := n ;
            c := [n] ;
            while true do
                    traj := A118881(traj) ;
                    if member(traj,c) then
                            return nops(c)-1 ;
                    end if;
                    c := [op(c),traj] ;
            end do:
    end proc: # R. J. Mathar, Jul 08 2012

A069816 a(n) = (sum of digits of n)^2 - (sum of digits^2 of n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 0, 14, 28, 42, 56, 70, 84
Offset: 0

Views

Author

N. J. A. Sloane, May 03 2002

Keywords

Comments

a(n) = 0 iff n is a single-digit number or is a power of ten times a single-digit number. - Robert G. Wilson v, May 04 2002

Examples

			n=14: sum of digits = 5, squaring gives 25; sum of squared digits of n = 1^2 + 4^2 = 17, so a(14) = 25 - 17 = 8.
		

Crossrefs

Cf. A067552.

Programs

  • Maple
    A007953 := proc(n) add(d, d=convert(n,base,10)) ; end proc: A003132:= proc(n) add(d^2, d=convert(n,base,10)) ; end proc: A118881 := proc(n) (A007953(n))^2 ; end proc: A069816 := proc(n) A118881(n)-A003132(n) ; end proc: seq(A069816(n),n=0..80) ; # R. J. Mathar, Jun 23 2009
  • Mathematica
    f[n_] := Plus @@ IntegerDigits[n]^2 - Plus @@ (IntegerDigits[n]^2); Table[ f[n], {n, 0, 100}]

Formula

From R. J. Mathar, Jun 23 2009: (Start)
a(n) = 2*A035930(n), n <= 100.
a(n) = A118881(n) - A003132(n). (End)

Extensions

Extended by Robert G. Wilson v, May 04 2002

A225567 Primes with nonzero digits such that sum of cubes of digits equal to square of sums.

Original entry on oeis.org

1423, 2143, 2341, 4231, 12253, 21523, 22153, 22531, 23251, 25321, 32251, 35221, 36343, 36433, 43633, 52321, 64333, 114451, 144511, 224461, 244261, 246241, 365557, 415141, 424261, 426421, 446221, 446461, 451411, 462421, 466441, 541141, 555637, 556537, 556573
Offset: 1

Views

Author

Balarka Sen, Jul 26 2013

Keywords

Comments

Largest term of this sequence is the 20-digit prime 99151111111111111111.
The Pagni article mentioned below has no bearing on this problem because it deals with the well-known identity sum_{i=1..n} i^3 = (sum_{i=1..n} i)^2. However, the article is interesting. - T. D. Noe, Jul 26 2013
This sequence has exactly 14068465 provable primes. This result required about one hour of Mathematica on fairly fast computer having 16 GB of memory. - T. D. Noe, Jul 30 2013

Examples

			a(5) = 12253 since 1^3 + 2^3 + 2^3 + 5^3 + 3^3 = (1 + 2 + 2 + 5 + 3)^2.
		

Crossrefs

Cf. A055012 (sum of cubes of digits), A118881 (square of sum of the digits).

Programs

  • Mathematica
    (* let tz[[i]] be numbers computed in A227073 *) Select[tz, PrimeQ] (* T. D. Noe, Jul 30 2013 *)
    pQ[n_]:=Module[{idn=IntegerDigits[n]},FreeQ[idn,0]&&Total[idn^3] == Total[ idn]^2]; Select[Prime[Range[50000]],pQ] (* Harvey P. Dale, Sep 17 2013 *)
  • PARI
    forprime(n=1, 10^7, v=digits(n); if(sum(i=1, length(v), v[i]^3)==sum(i=1, length(v), v[i])^2 & setsearch(Set(v),0)!=1, print1(n", ")))

Extensions

Corrected by T. D. Noe, Jul 26 2013

A225808 Values (Sum_{1<=i<=k} x_i)^2 = Sum_{1<=i<=k} x_i^3 for 1 <= x_1 <= x_2 <=...<= x_k ordered lexicographically according to (x1, x2,..., xk).

Original entry on oeis.org

1, 9, 16, 36, 81, 81, 100, 144, 256, 169, 225, 324, 361, 625, 144, 256, 324, 441, 324, 361, 441, 625, 256, 576, 729, 784, 576, 729, 900, 961, 1089, 1296, 484, 625, 784, 900, 484, 441, 576, 729, 784, 900, 1089, 1089, 1156, 1369, 625, 784, 729, 900, 1089, 1369, 1296, 1600, 900, 961, 1089
Offset: 1

Views

Author

Keywords

Comments

a(n) <= k^4 where k is the size of the ordered tuple (x_1, x_2,..., x_k).
This sequence is closed under multiplication, that is, if m and n are in this sequence, so is m*n.

Examples

			1;
9, 16;
36, 81;
81, 100, 144, 256;
169, 225, 324, 361, 625;
144, 256, 324, 441, 324, 361, 441, 625, 256, 576, 729, 784, 576, 729, 900, 961, 1089, 1296;
484, 625, 784, 900, 484, 441, 576, 729, 784, 900, 1089, 1089, 1156, 1369, 625, 784, 729, 900, 1089, 1369, 1296, 1600, 900, 961, 1089, 1600, 1296, 1600, 2025, 2401;
		

Crossrefs

Programs

  • Mathematica
    row[n_] := Reap[Module[{v, m}, v = Table[1, {n}]; m = n^(4/3); While[ v[[-1]] < m, v[[1]]++; If[v[[1]] > m, For[i = 2, i <= m, i++, If[v[[i]] < m, v[[i]]++; For[j = 1, j <= i - 1, j++, v[[j]] = v[[i]]]; Break[]]]]; If[Total[v^3] == Total[v]^2, Sow[Total[v]^2]]]]][[2, 1]];
    Array[row, 7] // Flatten (* Jean-François Alcover, Feb 23 2019, from PARI *)
  • PARI
    row(n)=my(v=vector(n,i,1),N=n^(4/3)); while(v[#v]N,for(i=2, N,if(v[i]
    				

A262721 Modified Look and Say sequence: compute sum of digits of previous term, square it, and apply the "Say What You See" process.

Original entry on oeis.org

1, 11, 14, 1215, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116, 1811, 111211, 1419, 2215, 1120, 1116
Offset: 0

Views

Author

Abdul Gaffar Khan, Sep 28 2015

Keywords

Comments

1. Generated with the help of sequence generated as follows:
c(0)=b, c(n)=k-th power of sum of digits of c(n-1).
Example: c(0)=1, c(n)=1 for all k hence convergent.
Example: c(0)=2, k=2, c(1)=4, c(2)=16, c(3)=49 as (1+6)^2=49.
Example: c(0)=3, k=2, c(n)=81 for all n, hence convergent.
In fact, for c(0)=3 and any k, a sequence generated by using this method converges.
(Methods G, V1 and V2 are explain in Link attached, namely "Generalization of A262721")
2. Every sequence generated by c(0)=b and any k, by using G, V1 or V2 has at least two convergent subsequences or in other words sequence generated by method G, V1 or V2 never converges for any b and k.
(2.1) For a(0)=1, k=2, and method G has 6 convergent subsequences with initial terms 1, 11, 14 and 1215 and converging to 1811, 111211, 1419, 2215, 1120, or 1116.
(2.2) For c(0)=1, k=2, and method V1 has 2 convergent subsequences with initial terms 1, 11, 14, 1215, 1118, 2112 and converging to 1316 and 2112.
(2.3) For c(0)=1, k=2, and method V2 has 2 convergent subsequences with initial terms 1, 11, 14, 15125, 1811, 1221 and converging to 1613 and 1221.
3. For any b and k, the least 'g-th' term of the sequence generated by methods G, V1 or V2 reaches a point at which one of the convergent subsequence of generated sequence,converges. That is, c(g) will be the converging point of one of the subsequence of generated sequence, but there is no subsequence which converges to the term c(m),m=0,...,g-1,with initial term read as c(0).
(3.1) For a(0)=1, k=2, method G we have g=4 with converging point 1811 by refering (2.1).
(3.2) For c(0)=1, k=2, method V1 we have g=5, with converging point 2112.
(3.3) For c(0)=1, k=2, method V2 we have g=5, with converging point 1221.
(3.4) For any b and k, the value of g for methods V1 and V2 is the same.
4. For method G, V1 or V2 with c(0)=b and k chosen randomly, the following holds:
(I) g<=k*23, for b=1 and for k<=100
(II) g<=k*23*b for k<=100
(III) g<=k*(23^(b+1)) for large values of k.
5. In the manner of A083671, sequence become periodic from 5th row with period of 6.

Examples

			a(0) = 1 has 1 digit, and the sum of digits is 1, and the square of the sum of digits is 1. So a(1) = 11, that is, one times 1.
a(1) = 11 has 2 digits, and the sum of digits is 1+1=2 and the square of the sum of digits is 4. So a(2) = 14, that is, one times 4.
Since a(2)=14, we compute 1+4=5, 5^2 = 25, where we see one 2 and one 5, so a(3)=1215.
		

Crossrefs

Cf. A005150 (Look and Say).
Cf. A118881 (square of sum of digits of n).
Cf. A005151 (Summarize the previous term! (in increasing order)).
Cf. A007890 (Summarize the previous term! (in decreasing order)).
Cf. A045918 (Describe n. Also called the "Say What You See" or "Look and Say" sequence LS(n).)

Programs

  • Mathematica
    A262721[0] := 1;
    A262721[n_] :=
    A262721[n] =
      FromDigits[
       Flatten[{Length[#], First[#]} & /@
         Split[IntegerDigits[
           Total[IntegerDigits[A262721[n - 1]]]^2]]]]; Table[
    A262721[n], {n, 0, 100}]
  • PARI
    say(n) = {d = digits(n); da = d[1]; na = 1; s = ""; for (k=2, #d, if (d[k] == da, na++, s = concat(s, Str(na, da)); na = 1; da = d[k]);); s = concat(s, Str(na, da)); eval(s);}
    lista(nn) = {print1(a=1, ", "); for (k=2, nn, a = say(sumdigits(a)^2); print1(a, ", "););} \\ Michel Marcus, Sep 29 2015

Formula

1. a(0) = 1, a(n) = 'frequency' of digits in the square of the sum of digits of a(n-1) followed by 'digit'-indication.
2. a(0) = 1, a(n) = A005150(A118881(a(n-1))). Here first deal with the type of operations of A118881 on a(n-1)-th term and then deal with the operation of A005150 on obtained value from A118881(a(n-1)) in last step, instead of following a(n-1) term of A118881 and A118881(a(n-1)) as a member of sequences A118881 and A005150 respectively.
a(0) = 1, a(n) = A045918(A118881(a(n-1))).

A270343 Numbers k that end with ( sum of digits of k )^2.

Original entry on oeis.org

0, 1, 81, 3144, 3256, 6225, 6484, 6576, 7121, 7529, 7676, 9100, 9324, 9361, 9729, 9784, 12144, 12256, 15225, 15484, 15576, 16121, 16529, 16676, 18100, 18324, 18361, 18729, 18784, 21144, 21256, 24225, 24484, 24576, 25121
Offset: 1

Views

Author

Soumil Mandal, Mar 15 2016

Keywords

Comments

All terms end with a digit from the set S = {0,1,4,5,6,9}.
The sum of the digits of the numbers repeat and also change with regular intervals. For example, the sum of the digits S1 = {12,16,15,22,24,11,23,26,10,18,19,27,28} which is followed by 3144 to 8784, 12144 to 18784, 21144 to 27784, 30144 to 36784. Again S2 = {21,25,15,22,24,11,23,26,10,18,19,27,28} is followed by 39441 to 45784, 48441 to 54784, 57441 to 67784, 66441 to 72784. It can be seen that a set containing 13 elements repeats itself for 4 consecutive ranges.

Examples

			For k=3256, sum of digits is 16 and 16^2 is 256.
For k=7121, sum of digits is 11 and 11^2 is 121.
For k=18784, sum of digits is 22 and 22^2 is 484.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 20000], Function[n, Function[k, If[n >= k, FromDigits@ Take[#, -IntegerLength@ k] == k, False]][Total[#]^2] &@ IntegerDigits@ n]] (* Michael De Vlieger, Mar 15 2016 *)
    esdQ[n_]:=Module[{idn=IntegerDigits[n],idn2=IntegerDigits[ Total[ IntegerDigits[ n]]^2]},Take[ idn,-Length[idn2]]==idn2]; Select[ Range[ 0,26000],esdQ]//Quiet (* Harvey P. Dale, Jan 01 2022 *)
  • PARI
    isok(n) = {sds = sumdigits(n)^2; nbs = #Str(sds); ((n - sds) % 10^nbs) == 0;} \\ Michel Marcus, Mar 16 2016
    
  • Python
    for i in range(0,200000):
        res = pow((sum(map(int,str(i)))),2)
        if(i%pow(10,len(str(res)))==res):print(i)
    # Soumil Mandal, Mar 17 2016

A344214 Numbers k such that repeated iterations of f(m) = (digsum(f(m-1)))^2 + 1 starting from f(1) = k will eventually yield 5 before any other single-digit number.

Original entry on oeis.org

5, 11, 15, 18, 19, 20, 24, 27, 28, 33, 36, 37, 39, 42, 45, 46, 48, 51, 54, 55, 57, 60, 63, 64, 66, 69, 72, 73, 75, 78, 81, 82, 84, 87, 90, 91, 93, 96, 99, 101, 105, 108, 109, 110, 114, 117, 118, 123, 126, 127, 129, 132, 135, 136, 138, 141, 144, 145, 147, 150, 153, 154
Offset: 1

Views

Author

Joseph Brown, May 11 2021

Keywords

Comments

f(x) = digsum(x)^2 + 1 < x for x >= 400, and all iterations terminate in a single digit or lead to the cycle 65 -> 122 -> 26. - Michael S. Branicky, May 14 2021

Examples

			11 is in the list because (1+1)^2 + 1 = 5.
12 is not in the list because repeatedly iterating the function starting with f(1) = 12 will yield 2 before 5.
13 is not in the list because it will never yield 5. Specifically, 13 -> 17 -> 65 -> 122 -> 26 -> 65 -> ... .
		

Crossrefs

Subsequence of A344208.

Programs

  • Mathematica
    Select[Range@100,Last@NestWhileList[Total[IntegerDigits@#]^2+1&,#,#>10&&#!=26&]==5&] (* Giorgos Kalogeropoulos, May 12 2021 *)
  • Python
    def f(n):
        s = 0
        while n > 0:
            s, n = s+n%10, n//10
        return s*s+1
    n, pota = 0, 0
    while n < 62:
        a, repf, i, ii = pota, 0, 0, 4
        while a > 9 and a != repf:
            a, i = f(a), i+1
            if i == ii:
                repf, ii = a, 2*ii
        if a == 5:
            n = n+1
            print(pota, end = ", ")
        pota = pota+1 # A.H.M. Smeets, May 13 2021
    
  • Python
    def f(x): return sum(map(int, str(x)))**2 + 1
    def ok(n):
      iter = n  # set to f(n) if number of iterations must be >= 1
      while iter > 9:
        if iter in {65, 122, 26}: return False
        iter = f(iter)
      return iter == 5
    print(list(filter(ok, range(1, 155)))) # Michael S. Branicky, May 19 2021

A279459 Numbers n such that sum of the proper divisors of n is the square of the sum of the digits of n.

Original entry on oeis.org

24, 153, 176, 794, 3071, 3431, 4607, 9671, 15599, 17711, 18167, 19511, 45671, 50927, 56471, 62807, 74639, 119279, 127559, 154199, 165791, 174719, 175871, 695399, 699359
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 12 2016

Keywords

Comments

Subsequence of A073040.
Numbers n such that A001065(n) = A118881(n) or A000203(n) - n = (A007953(n))^2.
Every term in the sequence is composite (since the only proper divisor of a prime is 1). The sum of the proper divisors of a k-digit composite number n must exceed sqrt(n) >= sqrt(10^(k-1)), but the square of the sum of the digits of a k-digit number cannot exceed (9k)^2 = 81k^2. Since sqrt(10^(k-1)) > 81k^2 for all integers k > 8, every term in the sequence must be less than the smallest 9-digit number, 10^8. An exhaustive search through 10^8 shows that a(25)=699359 is the last term. - Jon E. Schoenfield, Dec 13 2016

Examples

			24 is in the sequence because 24 has 7 proper divisors {1,2,3,4,6,8,12}, 1 + 2 + 3 + 4 + 6 + 8 + 12 = 36 and (2 + 4)^2 = 36;
153 is in the sequence because 153 has 5 proper divisors {1,3,9,17,51}, 1 + 3 + 9 + 17 + 51 = 81 and (1 + 5 + 3)^2 = 81;
176 is in the sequence because 176 has 9 proper divisors {1,2,4,8,11,16,22,44,88}, 1 + 2 + 4 + 8 + 11 + 16 + 22 + 44 + 88 = 196 and (1 + 7 + 6)^2 = 196, etc.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000000], DivisorSigma[1, #1] - #1 == Total[IntegerDigits[#1]]^2  &]
  • PARI
    is(n) = sigma(n)-n==sumdigits(n)^2 \\ Felix Fröhlich, Dec 13 2016
Showing 1-9 of 9 results.