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.

Previous Showing 61-70 of 118 results. Next

A171250 Row lengths of A082381: number of iterations of "sum of digits squared" until 1 or 4 is reached.

Original entry on oeis.org

1, 1, 11, 1, 8, 13, 5, 9, 10, 1, 2, 9, 2, 10, 10, 7, 9, 9, 4, 1, 9, 10, 3, 2, 7, 9, 10, 3, 6, 11, 2, 3, 10, 8, 9, 12, 6, 7, 11, 8, 10, 2, 8, 4, 11, 8, 9, 10, 4, 8, 10, 7, 9, 11, 9, 8, 10, 5, 8, 13, 7, 9, 12, 8, 8, 11, 6, 2, 12, 5, 9, 10, 6, 9, 10, 6, 5, 4, 3, 9, 9, 3, 7, 10, 5, 2, 4, 14, 4, 10, 4, 6, 11, 4, 8, 12, 3, 4, 12, 1
Offset: 1

Views

Author

M. F. Hasler, Dec 18 2009

Keywords

Comments

In the spirit of A082381, the map A003132 ("sum of digits squared") is applied at least once to the initial value n; the sequence gives the number of iterations until 1 or 4 is reached.

Crossrefs

Cf. A082381, A003132, A082382, A000216 (n=2), A000218 (n=3), A080709 (n=4), A000221 (n=5), A008460 (n=6), A008461 (n=7: ends in 1), A008462 (n=8), A008462 (n=9), A139566 (n=15), A122065 (n=74169), A000012 (n=1).

Programs

  • Mathematica
    Table[Length[NestWhileList[Total[IntegerDigits[#]^2]&,n,!MemberQ[{1,4},#]&]]-1,{n,100}]/.(0->1) (* Harvey P. Dale, Jun 08 2017 *)
  • PARI
    A171250(n)=my(c=0); until( n==4 || n==1, c++; n=norml2(eval(Vec(Str(n))))); c

Formula

a(n) = O(log* n).

Extensions

Formula from Charles R Greathouse IV, Aug 02 2010
Corrected and extended by Harvey P. Dale, Jun 08 2017

A210840 Sum of the 8th powers of the digits of n.

Original entry on oeis.org

0, 1, 256, 6561, 65536, 390625, 1679616, 5764801, 16777216, 43046721, 1, 2, 257, 6562, 65537, 390626, 1679617, 5764802, 16777217, 43046722, 256, 257, 512, 6817, 65792, 390881, 1679872, 5765057, 16777472, 43046977, 6561, 6562, 6817, 13122, 72097, 397186
Offset: 0

Views

Author

Jonathan Vos Post, May 10 2012

Keywords

Comments

This is to exponent 8 as A007953 is to exponent 0, A003132 is to exponent 2, and A055013 is to exponent 4. The subsequence of primes (for n = 11, 12, 14, 21, 41, ...) begins 2, 257, 65537, 65537.

Examples

			a(12) = 1^8 + 2^8 = 257.
		

Crossrefs

Programs

  • Magma
    [0] cat [&+[d^8: d in Intseq(n)]: n in [1..35]]; // Bruno Berselli, Feb 01 2013
  • Mathematica
    Table[Total[IntegerDigits[n]^8], {n, 0, 100}] (* T. D. Noe, May 18 2012 *)
    Table[Sum[DigitCount[n][[i]] i^8, {i, 9}], {n, 0, 35}] (* Bruno Berselli, Feb 01 2013 *)

A217390 Numbers n such that sum of squares of digits of n equals the sum of prime divisors of n.

Original entry on oeis.org

12, 581, 1014, 1036, 1180, 1272, 1746, 2553, 3420, 3741, 4140, 4544, 5104, 5238, 5313, 5966, 7134, 7272, 8174, 8346, 8549, 9153, 9525, 9536, 10476, 11070, 11800, 12350, 12882, 13481, 13702, 14045, 15341, 15974, 16415, 16999, 17051, 17220, 17444, 18361, 18798
Offset: 1

Views

Author

Michel Lagneau, Oct 05 2012

Keywords

Comments

n such that A003132(n) = A008472(n).

Examples

			581 =  7*83 is in the sequence because 5^2 + 8^2 + 1^2 = 7 + 83 = 90.
		

Crossrefs

Programs

  • Maple
    with(numtheory):A:= proc(n) add(u^2, u=convert(n, base, 10)) ; end proc: for i from 2 to 20000 do:x:=factorset(i):n1:=nops(x): s:=sum('x[i] ', 'i'=1..n1):if s=A(i) then printf(`%d, `,i):else fi:od:
  • Mathematica
    Rest[Select[Range[20000], Total[Transpose[FactorInteger[#]][[1]]]==Total[IntegerDigits[#]^2]&]]
  • PARI
    ok(n)={vecsum(factor(n)[, 1]) == vecsum(apply(d->d^2, digits(n)))} \\ Andrew Howroyd, Feb 25 2018

A254958 Zeroless numbers n with digits d_1, d_2, ... d_k such that d_1^2 + ... + d_k^2 is a square.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 34, 43, 68, 86, 122, 148, 184, 212, 221, 236, 244, 263, 269, 296, 326, 362, 366, 418, 424, 442, 447, 474, 481, 488, 623, 629, 632, 636, 663, 667, 676, 692, 744, 766, 814, 841, 848, 884, 926, 962, 1111, 1135, 1153, 1177, 1224, 1242, 1315, 1339, 1351, 1393, 1422, 1444, 1513, 1531, 1557
Offset: 1

Views

Author

Derek Orr, Feb 11 2015

Keywords

Comments

Any one of these terms can have an arbitrary number of 0's in between any two digits. Thus, the numbers with 0's have been omitted as trivial.

Crossrefs

Programs

  • Mathematica
    Select[Range[1557], (d = IntegerDigits[#]; Min[d] > 0 && IntegerQ@ Sqrt@ Total[d^2]) &] (* Giovanni Resta, Aug 14 2017 *)
  • PARI
    for(n=1,2000,d=digits(n);if(vecsort(d,,8)[1],s=0;for(i=1,#d,s+=d[i]^2);if(issquare(s),print1(n,", "))))

A259567 Number of subsequent numbers, starting with n, for which A258881(x) = x + (sum of squares of digits of x) is prime.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Jul 19 2015

Keywords

Comments

This sequence is motivated by sequence A259391 and the "Prime puzzle 776".

Examples

			For n = 0, A258881(0) = 0 is not prime.
For n = 1, A258881(1) = 1+1 = 2 is prime, but A258881(2) = 2+4 is not prime, therefore a(1)=1.
For n = 10, A258881(10) = 10 + 1^2 + 0^2 = 11, A258881(11) = 11 + 1^2 + 1^2 = 13, A258881(12) = 12 + 1^2 + 2^2 = 17, ..., A258881(19) = 19 + 1^2 + 9^2 = 101 are all prime, but A258881(20) = 20 + 2^2 + 0^2 is not prime, therefore a(10) = 10.
The next value of 10 occurs at index n = 1761702690, see A259391.
		

Crossrefs

Programs

  • PARI
    a(n)=for(m=n,n+9e9,isprime(A258881(m))||return(m-n))

Formula

If a(n) > 0, then a(n+1) = a(n)-1.
a(n) > 0 iff n is in A076161.

A290223 Algorithm: s(k) = n. s(k+1) = s(k) - digitsum(s(k))^2 if s(k) >= 0 and s(k+1) = s(k)+digitsum(abs(s(k)))^2 if s(k) < 0. Below gives the end behavior for each number n.

Original entry on oeis.org

0, 2, 3, 6, 6, 6, 3, 11, 9, 9, 3, 3, 6, 6, 6, 3, 11, 9, 0, 3, 3, 6, 2, 6, 3, 11, 9, 9, 11, 3, 6, 3, 6, 3, 11, 9, 9, 11, 3, 6, 3, 6, 3, 6, 9, 9, 11, 3, 6, 3, 6, 3, 6, 9, 9, 11, 3, 6, 6, 6, 3, 2, 9, 9, 11, 3, 6, 6, 6, 3, 3, 9, 9, 11, 3, 6, 2, 6, 3, 3, 0, 9, 11, 3, 6, 6, 6, 3, 6, 9, 9, 11, 3, 6, 6, 6, 3, 6, 9, 9, 3, 3, 6, 3, 6, 3, 3, 9, 9
Offset: 1

Views

Author

Derek Orr, Jul 24 2017

Keywords

Comments

0 means the sequence s(k) becomes the 0 sequence.
2 means the sequence s(k) becomes 2, -2, 2, -2, ...
3 means the sequence s(k) becomes 3, -6, 30, 21, 12, 3, ...
6 means the sequence s(k) becomes 6, -30, -21, -12, -3, 6, ...
9 means the sequence s(k) oscillates between two numbers, each of which have a digit sum of 9. For example, 18 -> -63 -> 18 -> -63 -> ... so a(18) = 9.
11 means the sequence s(k) oscillates between two numbers, each of which have a digit sum of 11. For example, 65 -> -56 -> 65 -> ... so a(65) = 11.
a(n) = 2 for n = 2, 23, 62, 77, 119, 194, 287, 398. The next number n such that a(n) = 2 is over 10^5. This is believed to be finite.
a(n) = 11 for n = 8, 17, 26, 29, 35, 38, 47, 56, 65, 74, 83, 92, 149, 158, 167, 197. The next number n is over 10^5. This is believed to be finite.
The subsequences when a(n)=0, 3, 6, and 9 are believed to be infinite.

Examples

			a(19) = 0 because 19 - (1+9)^2 = -81. Then -81 + (8+1)^2 = 0.
a(13) = 6 because 13 - (1+3)^2 = -3. Then -3 + (3)^2 = 6.
a(17) = 11 because 17 - (1+7)^2 = -47. Then -47 + (4+7)^2 = 74. Then 74 - (7+4)^2 = -47, and so on.
a(23) = 2 because 23 - (2+3)^2 = -2. Then -2 + (2)^2 = 2.
a(25) = 3 because 25 - (2+5)^2 = -24. Then -24 + (2+4)^2 = 12. Then 12 - (1+2)^2 = 3.
a(28) = 9 because 28 - (2+8)^2 = -72. Then -72 + (7+2)^2 = 9. Then 9-(9)^2 = -72, and so on.
		

Crossrefs

Programs

  • PARI
    a(n)=k=n;c=1;v=List();listput(v,k);while(c,if(k>=0,k-=sumdigits(k)^2;c+=1;if(k==2||k==3||k==0||k==6||k==9,return(k));if(vecsearch(Vec(v),k),return(sumdigits(abs(k))));listput(v,k));if(k<0,k+=sumdigits(-k)^2;c+=1;if(k==2||k==3||k==0||k==6||k==9,return(k));if(vecsearch(Vec(v),k),return(sumdigits(abs(k))));listput(v,k));c+=1)

A379980 Numbers that are divisible by the square of the sum of the squares of their digits.

Original entry on oeis.org

1, 10, 100, 1000, 1100, 1200, 1300, 2000, 2023, 2100, 2400, 3100, 4332, 5000, 10000, 10100, 10200, 10300, 11000, 12000, 13000, 20000, 20100, 20230, 20400, 21000, 24000, 30100, 30324, 31000, 31311, 42000, 43011, 43320, 50000, 52022, 52215, 55000, 71824, 100000
Offset: 1

Views

Author

Amiram Eldar, Jan 07 2025

Keywords

Comments

Called "Second-order Harshad numbers" by Pal and Gopalan (2023).
If k is a term, then 10*k is also a term.

Examples

			10 is a term since 10 is divisible by (1^2 + 0^2)^2 = 1.
1100 is a term since 1100 is divisible by (1^2 + 1^2 + 0^2 + 0^2)^2 = 4.
		

Crossrefs

Cf. A003132, A005349, A072081, A180490 (binary analog).
Subsequence of A034087.
Subsequences: A379981, A379982.

Programs

  • Mathematica
    Select[Range[10^5], Divisible[#, (Plus @@ (IntegerDigits[#]^2))^2] &]
  • PARI
    isok(k) = !(k % vecsum(apply(x -> x^2, digits(k)))^2);
    
  • Python
    def ok(n): return n and n%sum(di**2 for di in map(int, str(n)))**2 == 0
    print([k for k in range(100001) if ok(k)]) # Michael S. Branicky, Jan 10 2025

A109902 Happy primes of the form a*10^k + b with single-digit a and b, a > 0, k > 0.

Original entry on oeis.org

13, 19, 23, 31, 79, 97, 103, 109, 409, 709, 907, 1009, 2003, 3001, 9001, 9007, 10009, 40009, 70009, 90001, 90007, 100003, 200003, 400009, 900001, 900007, 1000003, 2000003, 7000009, 20000003, 30000001, 400000009, 1000000009, 4000000009, 9000000001
Offset: 1

Views

Author

Paul Muljadi, Jun 22 2007

Keywords

Comments

The subset of numbers of A035497 with the internal digits in the decimal representation all zero.
A number is in this sequence if and only if it is a prime of the form a00...00b, where (a,b) is one of (1,3), (1,9), (2,3), (3,1), (4,9), (7,9), (9,1), or (9,7). - Nathaniel Johnston, Apr 30 2011

Crossrefs

Cf. A035497.

Programs

  • Maple
    A003132 := proc(n) local digs,i ; digs := convert(n,base,10) ; add( (op(i,digs))^2,i=1..nops(digs)) ; end: isA035497 := proc(n) local nItr ; nItr := n ; if isprime(n) then while true do if nItr = 0 or nItr=4 or nItr = 16 or nItr = 20 or nItr = 37 or nItr = 42 or nItr =58 or nItr =89 or nItr = 145 then RETURN(false) ; elif nItr = 1 then RETURN(true) ; fi ; nItr := A003132(nItr) ; od ; else false ; fi ; end: isA109902 := proc(n) local digs,d ; if isprime(n) and n > 9 then digs := convert(n,base,10) ; for d from 2 to nops(digs)-1 do if op(d,digs) <> 0 then RETURN(false) ; fi ; od ; RETURN(isA035497(n)) ; else RETURN(false) ; fi ; end: for i from 1 to 20000 do p := ithprime(i) : if isA109902(p) then printf("%d,",p) ; fi ; od:
    diglim:=20: dig:=[[1,3],[1,9],[2,3],[3,1],[4,9],[7,9],[9,1],[9,7]]: for k from 1 to diglim do for m from 1 to 8 do n:=dig[m][1]*10^k + dig[m][2]: if(isprime(n))then printf("%d, ",n): fi:od:od: # Nathaniel Johnston, Apr 30 2011
  • Mathematica
    Select[Sort[Flatten[With[{ab={{1,3},{1,9},{2,3},{3,1},{4,9},{7,9},{9,1},{9,7}}},Table[FromDigits[Join[PadRight[{ab[[n,1]]},i,0],{ab[[n,2]]}]],{n,8},{i,9}]]]],PrimeQ] (* Harvey P. Dale, May 31 2013 *)

Extensions

Edited by R. J. Mathar, Jul 13 2007
a(24) - a(35) from Nathaniel Johnston, Apr 30 2011

A167412 Primes p such that sum of (digits^2) + 1 is prime.

Original entry on oeis.org

2, 11, 13, 19, 31, 37, 59, 73, 79, 97, 101, 103, 109, 163, 181, 211, 233, 251, 257, 277, 307, 349, 383, 439, 499, 509, 521, 541, 563, 587, 613, 631, 653, 709, 727, 769, 787, 811, 857, 877, 907, 929, 967, 1009, 1021, 1063, 1117, 1151, 1153, 1171, 1201, 1223
Offset: 1

Views

Author

Vincenzo Librandi, Nov 03 2009

Keywords

Comments

11 is a term because 1^2 + 1^2 + 1 = 3 (prime);
163 is a term because 1^2 + 6^2 + 3^2 + 1 = 47;
277 is a term because 2^2 + 7^2 + 7^2 + 1 = 103.

Crossrefs

Cf. A167414.

Programs

  • Maple
    A003132 := proc(n) local d; add(d^2,d=convert(n,base,10)) ; end proc: A167412 := proc(n) local p; if n = 1 then 2; else p := nextprime(procname(n-1)) ; while not isprime(A003132(p)+1) do p := nextprime(p) ; end do ; return p end if ; end proc: seq(A167412(n),n=1..80) ; # R. J. Mathar, Nov 04 2009
  • Mathematica
    Select[Prime[Range[2000]], PrimeQ[Total[IntegerDigits[#]^2] + 1]&] (* Vincenzo Librandi, Sep 25 2014 *)

Extensions

2, 211, 233 inserted and more terms after 653 added by R. J. Mathar, Nov 04 2009

A167414 Primes p such that sum of their squared decimal digits, minus one, is prime.

Original entry on oeis.org

2, 127, 149, 211, 251, 271, 277, 347, 419, 457, 491, 521, 523, 541, 547, 587, 727, 743, 853, 857, 941, 1021, 1049, 1061, 1087, 1201, 1223, 1229, 1249, 1289, 1373, 1409, 1423, 1429, 1483, 1553, 1559, 1601, 1621, 1627, 1733, 1753, 1861, 1867, 1951, 1973
Offset: 1

Views

Author

Vincenzo Librandi, Nov 03 2009

Keywords

Comments

127 is a term because 1^2 + 2^2 + 7^2 - 1 = 53 (prime);
149 is a term because 1^2 + 4^2 + 9^2 - 1 = 97;
347 is a term because 3^2 + 4^2 + 7^2 - 1 = 73.

Crossrefs

Cf. A167412.

Programs

  • Maple
    A003132 := proc(n) local d; add(d^2,d=convert(n,base,10)) ; end proc: A167414 := proc(n) local p; if n = 1 then 2; else p := nextprime(procname(n-1)) ; while not isprime(A003132(p)-1) do p := nextprime(p) ; end do ; return p end if ; end proc: seq(A167414(n),n=1..80) ; # R. J. Mathar, Nov 04 2009
  • Mathematica
    Select[Prime[Range[3000]], PrimeQ[Total[IntegerDigits[#]^2] - 1] &] (* Vincenzo Librandi, Sep 25 2014 *)

Extensions

2 and terms larger than 941 added by R. J. Mathar, Nov 04 2009
Previous Showing 61-70 of 118 results. Next