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

A052034 Primes such that the sum of the squares of their digits is also a prime.

Original entry on oeis.org

11, 23, 41, 61, 83, 101, 113, 131, 137, 173, 179, 191, 197, 199, 223, 229, 311, 313, 317, 331, 337, 353, 373, 379, 397, 401, 409, 443, 449, 461, 463, 467, 601, 641, 643, 647, 661, 683, 719, 733, 739, 773, 797, 829, 863, 883, 911, 919, 937, 971, 977, 991, 997, 1013
Offset: 1

Views

Author

Patrick De Geest, Dec 15 1999

Keywords

Comments

Primes p such that the sum of the squared digits of p is a prime q. For the values of q see A109181.

Examples

			p = 23 is in the sequence because q = 2^2 + 3^2 = 13 is a prime.
9431 -> 9^2 + 4^2 + 3^2 + 1^2 = 107 (which is prime).
		

References

  • Clifford A. Pickover, A Passion for Mathematics, John Wiley & Sons, Inc., 2005, p. 89.
  • Charles W. Trigg, Journal of Recreational Mathematics, Vol. 20(2), 1988.

Crossrefs

Programs

  • Maple
    a:=proc(n) local nn, L: nn:=convert(n,base,10): L:=nops(nn): if isprime(n)= true and isprime(add(nn[j]^2,j=1..L))=true then n else end if end proc: seq(a(n),n=1..1000); # Emeric Deutsch, Jan 08 2008
  • Mathematica
    Select[Prime[Range[250]],PrimeQ[Total[IntegerDigits[#]^2]]&]  (* Harvey P. Dale, Dec 19 2010 *)
  • Python
    from sympy import isprime, primerange
    def ok(p): return isprime(sum(int(d)**2 for d in str(p)))
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(1013)) # Michael S. Branicky, Nov 23 2021

Extensions

Edited by N. J. A. Sloane, Dec 15 2007 and again on Dec 05 2008 at the suggestion of Zak Seidov

A182404 Numbers whose digit sum as well as sum of the squares of the digits is a prime.

Original entry on oeis.org

11, 12, 14, 16, 21, 23, 25, 32, 38, 41, 49, 52, 56, 58, 61, 65, 83, 85, 94, 101, 102, 104, 106, 110, 111, 113, 119, 120, 131, 133, 137, 140, 146, 160, 164, 166, 173, 179, 191, 197, 199, 201, 203, 205, 210, 223, 229, 230, 232, 250, 289, 292, 298, 302, 308
Offset: 1

Views

Author

Sumit Maheshwari, May 09 2010

Keywords

Examples

			25 is here because 2 + 5 = 7 and 2*2 + 5*5 = 29 both are prime.
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := Module[{d = IntegerDigits[n]}, PrimeQ[Total[d]] && PrimeQ[Total[d^2]]]; Select[Range[500], fQ] (* T. D. Noe, May 09 2012 *)

Formula

Intersection of A028834 and A108662. - Jason Yuen, Oct 15 2024

Extensions

Incorrect comment removed by Jason Yuen, Oct 15 2024

A234021 Numbers with digits in nondecreasing order such that sum of squares of digits is a prime.

Original entry on oeis.org

11, 12, 14, 16, 23, 25, 27, 38, 45, 49, 56, 58, 78, 111, 113, 119, 126, 133, 137, 146, 159, 166, 168, 179, 199, 223, 229, 234, 249, 267, 289, 335, 337, 344, 346, 348, 355, 357, 368, 377, 379, 388, 449, 467, 559, 566, 678, 689, 779, 799, 1112, 1114, 1118, 1125
Offset: 1

Views

Author

Zak Seidov, Dec 31 2013

Keywords

Comments

Primitive solutions of A108662. Intersection of A009994 and A108662.

Crossrefs

Programs

  • Mathematica
    Select[Range[1125],LessEqual@@(id=IntegerDigits[#])&&PrimeQ[Total[id^2]]&] (* Ray Chandler, Dec 31 2013 *)

A307735 Integers k such that if m = k + A003132(k) then k = m - A003132(m).

Original entry on oeis.org

0, 9, 205, 212, 217, 366, 457, 663, 1314, 1315, 1348, 1672, 1742, 1792, 1797, 2005, 2012, 2017, 2129, 2201, 2208, 2213, 2216, 2305, 2404, 2405, 2465, 2564, 2565, 2671, 2741, 2748, 2789, 2829, 3114, 3115, 3205, 3303, 3306, 3394, 3436, 3475, 3696, 3819, 4204, 4205, 4245, 4347, 4475, 4542, 4629, 4647, 4688
Offset: 1

Views

Author

Antonio Roldán, Apr 25 2019

Keywords

Comments

A003132(n) is the sum of the squares of the digits of n.

Examples

			205 is in the sequence because 205 + 2^2 + 0^2 + 5^2 = 234 and 234 - 2^2 - 3^2 - 4^2 = 205.
		

Crossrefs

Programs

  • Mathematica
    sod2[n_] := Total @ (IntegerDigits[n]^2); aQ[n_] := sod2[n + (s=sod2[n])] == s; Select[Range[0, 4700], aQ] (* Amiram Eldar, Jul 03 2019 *)
  • PARI
    for(i = 0 , 5000 , a = i + norml2(digits(i)) ; b = a - norml2(digits(a)) ; if(i == b , print1(i , ", ")))

A177149 Indices n such that the sums of the squares of the digits of prime(n) are prime.

Original entry on oeis.org

5, 9, 13, 18, 23, 26, 30, 32, 33, 40, 41, 43, 45, 46, 48, 50, 64, 65, 66, 67, 68, 71, 74, 75, 78, 79, 80, 86, 87, 89, 90, 91, 110, 116, 117, 118, 121, 124, 128, 130, 131, 137, 139, 145, 150, 153, 156, 157, 159, 164, 165, 167, 168, 170, 171, 173, 174, 182, 184, 185
Offset: 1

Views

Author

Michel Lagneau, May 03 2010

Keywords

Comments

n such that prime(n) is in A108662. - Robert Israel, Aug 05 2019

Examples

			5 is in the sequence because the 5th prime is 11, and 1^2 + 1^2 = 2 prime;
9 is in the sequence because the 9th prime is 23, and 2^2 + 3^2 = 13 prime;
139 is in the sequence because the 139th prime is 797, and 7^2 + 9^2 + 7^2 =179 prime.
		

Crossrefs

Cf. A108662.

Programs

  • Maple
    with(numtheory): nn:= 150: T:=array(1..nn):k:=1:for n from 1 to 731 do:p:=ithprime(n):l:=evalf(floor(ilog10(p))+1):n0:=p:s:=0:for m from 1 to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+u^2:od:if type(s,prime)=true then T[k]:=n:k:=k+1: else fi:od:print(T):
    # Simpler:
    filter:= proc(n) isprime(add(t^2,t=convert(ithprime(n),base,10))) end proc:
    select(filter, [$1..1000]); # Robert Israel, Aug 05 2019
  • Mathematica
    Select[Range[200],PrimeQ[Total[IntegerDigits[Prime[#]]^2]]&] (* Harvey P. Dale, Jan 10 2021 *)

A181364 Fibonacci numbers whose digits, when squared, sum to a prime.

Original entry on oeis.org

21, 377, 610, 2584, 17711, 75025, 196418, 514229, 63245986, 701408733, 1134903170, 1836311903, 2971215073, 17167680177565, 72723460248141, 117669030460994, 2880067194370816120, 19740274219868223167, 354224848179261915075, 1500520536206896083277
Offset: 1

Views

Author

Carmine Suriano, Oct 15 2010

Keywords

Examples

			a(5) = 17711 = Fibonacci(22) since 1^2+7^2+7^2+1^2+1^2 = 1+49+49+1+1 = 101 is prime.
		

Crossrefs

Intersection of A000045 and A108662.

Programs

  • Mathematica
    Select[Fibonacci[Range[150]],PrimeQ[Total[IntegerDigits[#]^2]]&] (* Harvey P. Dale, Feb 27 2012 *)

Formula

a(n) = A000045(A178838(n)). - Michel Marcus, Sep 01 2025

Extensions

Corrected and extended by Harvey P. Dale, Feb 27 2012

A245475 Numbers n such that the sum of digits, sum of squares of digits, and sum of cubes of digits are all prime.

Original entry on oeis.org

11, 101, 110, 111, 113, 131, 146, 164, 166, 199, 223, 232, 289, 298, 311, 322, 335, 337, 346, 353, 355, 364, 373, 388, 416, 436, 449, 461, 463, 494, 533, 535, 553, 566, 614, 616, 634, 641, 643, 656, 661, 665, 733, 829, 838, 883, 892, 919, 928, 944, 982, 991, 1001, 1010, 1011, 1013, 1031, 1046, 1064, 1066, 1099
Offset: 1

Views

Author

Derek Orr, Jul 23 2014

Keywords

Comments

There are infinitely many numbers in this sequence; 0's can be added to any number any number of times in any logical order (i.e., the number doesn't start with a zero).

Examples

			1^1 + 4^1 + 6^1 = 11 is prime.
1^2 + 4^2 + 6^2 = 53 is prime.
1^3 + 4^3 + 6^3 = 281 is prime.
Thus 146, 164, 416, 461, 641, and 614 are members of this sequence.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L;
      L:= convert(n,base,10);
      isprime(convert(L,`+`)) and
      isprime(convert(map(`^`,L,2),`+`)) and
      isprime(convert(map(`^`,L,3),`+`))
    end proc:
    select(filter, [$1..2000]); # Robert Israel, Dec 04 2024
  • Mathematica
    sdpQ[n_]:=Module[{idn=IntegerDigits[n]},AllTrue[{Total[idn], Total[ idn^2], Total[ idn^3]}, PrimeQ]]; Select[Range[1100],sdpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 06 2018 *)
  • PARI
    for(n=1,10^3,d=digits(n);s1=sum(i=1,#d,d[i]);s2=sum(j=1,#d,d[j]^2);s3=sum(k=1,#d,d[k]^3);if(isprime(s1)&&isprime(s2)&&isprime(s3),print1(n,", ")))

A344366 Integers k such that the sum of squares of digits of both k and k-1 are prime.

Original entry on oeis.org

12, 102, 111, 120, 160, 230, 250, 380, 410, 450, 520, 560, 720, 780, 830, 870, 1002, 1011, 1020, 1060, 1100, 1101, 1110, 1370, 1640, 1680, 1910, 1950, 1970, 1990, 2030, 2050, 2340, 2670, 2920, 3080, 3170, 3240, 3420, 3460, 3550, 3570, 3710, 3840, 3860, 4010
Offset: 1

Views

Author

Charles U. Lonappan, May 19 2021

Keywords

Comments

Integers k such that k and k-1 are both in A108662.
Terms are never prime. They cannot end in the digits 3,4,5,6,7,8,9.
If k is a term, phi(k) is divisible by 4.
The set of such numbers is infinite.

Examples

			12 is in the sequence because the sum of squares of digits of 12 is 5 and that of 11 is 2, and both 5 and 2 are prime numbers.
		

Crossrefs

Cf. A108662.

Programs

  • Mathematica
    q[n_] := PrimeQ[Plus @@ (IntegerDigits[n]^2)]; Select[Range[2, 5000], q[#-1] && q[#] &] (* Amiram Eldar, May 19 2021 *)
  • PARI
    isok(k) = isprime(norml2(digits(k-1))) && isprime(norml2(digits(k))); \\ Michel Marcus, May 24 2021

A359449 Positive integers in which the sum of the k-th powers of their digits is a prime number for k = 1, 2, 3, 4, 5, and 6 but not for k=7.

Original entry on oeis.org

223, 232, 322, 1349, 1394, 1439, 1493, 1934, 1943, 2023, 2032, 2203, 2230, 2302, 2320, 3022, 3149, 3194, 3202, 3220, 3419, 3491, 3914, 3941, 4139, 4193, 4319, 4391, 4913, 4931, 9134, 9143, 9314, 9341, 9413, 9431, 10349, 10394, 10439, 10493, 10934, 10943, 13049, 13094, 13409, 13490, 13904, 13940
Offset: 1

Views

Author

José Hernández, Jan 02 2023

Keywords

Examples

			223 belongs to this sequence because 2+2+3=7, 2^2+2^2+3^2=17, 2^3+2^3+3^3=43, 2^4+2^4+3^4=113, 2^5+2^5+3^5=307, and 2^6+2^6+3^6=857 are prime numbers whereas 2^7+2^7+3^7 is a composite number.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L,t,k;
      L:= convert(n,base,10);
      andmap(isprime, [seq(add(t^k,t=L),k=1..6)]) and not isprime(add(t^7,t=L))
    end proc:
    select(filter, [$1..20000]); # Robert Israel, Jan 03 2023
  • Mathematica
    For[a = 0, a <= 9, a++,
     For[b = 0, b <= 9, b++,
     For[c = 0, c <= 9, c++,
     For[d = 0, d <= 9, d++,
       If[PrimeQ[a + b + c + d] == True &&
          PrimeQ[a^2 + b^2 + c^2 + d^2] == True &&
          PrimeQ[a^3 + b^3 + c^3 + d^3] == True &&
          PrimeQ[a^4 + b^4 + c^4 + d^4] == True &&
          PrimeQ[a^5 + b^5 + c^5 + d^5] == True &&
          PrimeQ[a^6 + b^6 + c^6 + d^6] == True &&
          PrimeQ[a^7 + b^7 + c^7 + d^7] == False, Print[a, b, c, d]]]]]]
    (* This code outputs all the terms of the sequence in the interval [1,10^4]. *)
  • PARI
    isok(n) = my(d=digits(n)); for (i=1, 6, if (!isprime(sum(k=1,#d, d[k]^i)), return(0))); !isprime(sum(k=1,#d, d[k]^7)); \\ Michel Marcus, Jan 02 2023

A359610 Numbers k such that the sum of the 5th powers of the digits of k is prime.

Original entry on oeis.org

11, 101, 110, 111, 119, 128, 133, 182, 188, 191, 218, 223, 227, 229, 232, 247, 272, 274, 281, 292, 313, 322, 331, 337, 346, 359, 364, 368, 373, 377, 379, 386, 395, 397, 427, 436, 463, 472, 478, 487, 539, 557, 568, 575, 577, 586, 593, 634, 638, 643, 658, 667
Offset: 1

Views

Author

José Hernández, Jan 06 2023

Keywords

Comments

It is easy to establish that the sequence is infinite: if x is in the sequence, so is 10*x.
Alternatively: the sequence is infinite as the sequence contains all numbers consisting of a prime number of 1s and an arbitrary number of 0s. - Charles R Greathouse IV, Jan 06 2023

Examples

			11 is a term since 1^5 + 1^5 = 2 is prime.
		

Crossrefs

A031974 is a subsequence.
Cf. A055014 (sum of the 5th powers of digits).

Programs

  • Mathematica
    top = 999; (* Find all terms <= top *)
    For[t = 11, t <= top, t++, k = IntegerLength[t]; sum = 0;
       For[e = 0, e <= k - 1, e++, sum = sum + NumberDigit[t, e]^5];
          If[PrimeQ[sum] == True, Print[t]]]
    Select[Range[670],PrimeQ[Total[IntegerDigits[#]^5]] &] (* Stefano Spezia, Jan 08 2023 *)
  • PARI
    isok(k) = isprime(vecsum(apply(x->x^5, digits(k)))); \\ Michel Marcus, Jan 07 2023
Showing 1-10 of 10 results.