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 62 results. Next

A075177 Indices of additive primes - primes with prime sum-of-digits, see A046704.

Original entry on oeis.org

1, 2, 3, 4, 5, 9, 10, 13, 14, 15, 18, 19, 23, 24, 26, 30, 32, 33, 34, 36, 37, 40, 41, 43, 44, 45, 46, 48, 49, 50, 53, 56, 57, 60, 61, 64, 65, 66, 67, 68, 71, 72, 74, 75, 78, 79, 80, 82, 86, 87, 89, 90, 91, 93, 102, 105, 106, 108, 109, 110, 111, 116, 117, 118, 121, 124, 128
Offset: 1

Views

Author

Zak Seidov, Sep 06 2002

Keywords

Comments

There are 107 additive primes among first 200 primes. There are 38455 additive primes among first 100000 primes. Additive primes are in A046704.

Examples

			Prime(10) = 29 is an additive prime because 2+9 = 11 is prime.
		

Crossrefs

Programs

Formula

a(n) = PrimePi(A046704(n)).
A000040(a(n)) = A046704(n).

A156604 a(1)=2; for n > 0, a(n+1) is the smallest prime of A046704 larger than a(n) such that the sequence of digit sums of a(n) is nondecreasing.

Original entry on oeis.org

2, 3, 5, 7, 29, 47, 67, 89, 179, 197, 199, 379, 397, 487, 577, 599, 797, 887, 977, 1499, 1697, 1787, 1877, 1949, 2399, 2579, 2687, 2777, 2939, 2957, 2999, 3989, 4799, 4889, 4999, 6997, 7699, 7789, 7879, 8599, 8689, 8779, 8887, 9679, 9697, 9769, 9787, 9859
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 11 2009

Keywords

Comments

The slowest increasing sequence that is a subsequence of A046704 such that the sequence of A007953(a(n)) is nondecreasing. - R. J. Mathar, Mar 29 2010

Examples

			The first several terms after a(1)=2 are
    3 (3 > 2);
    5 (5 > 3);
    7 (7 > 5);
   29 (2 + 9 > 7);
   47 (4 + 7 = 2 + 9);
   67 (6 + 7 > 4 + 9);
   89 (8 + 9 > 6 + 7);
  179 (1 + 7 + 9 = 8 + 9);
  197 (1 + 9 + 7 = 8 + 9).
		

Crossrefs

Programs

  • Maple
    A007953 := proc(n) local d ; add(d,d= convert(n,base,10)) ; end proc:
    isA046704 := proc(n) isprime(n) and isprime(A007953(n)) ; end proc:
    A156604 := proc(n) option remember ; local psprev,i ; if n = 1 then 2 ; else psprev := A007953(procname(n-1)) ; for i from procname(n-1)+1 do if isA046704(i) then if A007953(i) >= psprev then return i ; end if; end if; end do: end if ; end proc:
    seq(A156604(n),n=1..80) ; # R. J. Mathar, Mar 18 2010
    From R. J. Mathar, Mar 29 2010: (Start)
    A007953 := proc(n) add(d, d= convert(n,base,10)) ; end proc:
    isA028834 := proc(n) local d; add(d, d= convert(n,base,10)) ; isprime(%) ; end proc:
    isA046704 := proc(n) isprime(n) and isA028834(n) ; end proc:
    A156604 := proc(n) option remember; if n = 1 then 2; else for a from procname(n-1)+1 do if isA046704(a) and A007953(a) >= A007953(procname(n-1)) then return a; end if; end do: end if; end proc: seq(A156604(n),n=1..100) ; (End)

Extensions

Definition, terms and examples corrected by R. J. Mathar, Mar 18 2010
179 and 1877 inserted, and 9 terms after 4889 replaced with the single term 4999, by R. J. Mathar, Mar 29 2010

A146972 Twin primes in A046704.

Original entry on oeis.org

3, 5, 7, 41, 43, 137, 139, 191, 193, 197, 199, 227, 229, 281, 283, 311, 313, 461, 463, 599, 601, 641, 643, 821, 823, 827, 829, 881, 883, 1031, 1033, 1091, 1093, 1277, 1279, 1301, 1303, 1451, 1453, 1721, 1723, 1871, 1873, 2027, 2029, 2081, 2083, 2087, 2089
Offset: 1

Views

Author

Dmitry Kamenetsky, Nov 03 2008

Keywords

Examples

			137 and 139 are twin primes. The sum of their digits are 11 and 13 respectively, which are also twin primes.
		

Crossrefs

A028834 Numbers whose sum of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 49, 50, 52, 56, 58, 61, 65, 67, 70, 74, 76, 83, 85, 89, 92, 94, 98, 101, 102, 104, 106, 110, 111, 113, 115, 119, 120, 122, 124, 128, 131, 133, 137, 139, 140, 142, 146, 148, 151, 155, 157, 160, 164, 166, 173, 175, 179, 182
Offset: 1

Views

Author

Armand Turpel (armand(AT)vo.lu, armand_t(AT)geocities.com)

Keywords

Examples

			89 included because 8+9 = 17, which is prime.
		

Crossrefs

Cf. A010051; A046704 is a subsequence.
Complement of A104211.

Programs

  • Haskell
    a028834 n = a028834_list !! (n-1)
    a028834_list = filter ((== 1) . a010051 . a007953) [1..]
    -- Reinhard Zumkeller, Nov 13 2011
    
  • Maple
    a:=proc(n) local nn: nn:=convert(n,base,10): if isprime(sum(nn[j],j=1..nops(nn)))=true then n else fi end: seq(a(n),n=1..200); # Emeric Deutsch, Mar 17 2007
  • Mathematica
    Select[Range[200],PrimeQ[Total[IntegerDigits[#]]]&]  (* Harvey P. Dale, Feb 18 2011 *)
  • PARI
    is(n)=isprime(sumdigits(n)) \\ Felix Fröhlich, Aug 16 2014
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(sum(map(int, str(n))))
    print(list(filter(ok, range(183)))) # Michael S. Branicky, Jun 18 2021
    
  • R
    require(gmp); which(sapply(1:1000, function(i) isprime(sum(floor(i/10^(0:(nchar(i)-1)))%%10)))==2) # Christian N. K. Anderson, Apr 22 2024
  • Sage
    [x for x in range(200) if (sum(Integer(x).digits(base=10))) in Primes()] # Bruno Berselli, May 05 2014
    

Extensions

More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)

A081092 Primes having a prime number of 1's in their binary representation.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 31, 37, 41, 47, 59, 61, 67, 73, 79, 97, 103, 107, 109, 127, 131, 137, 151, 157, 167, 173, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 271, 283, 307, 313, 331, 367, 379, 397, 409, 419, 421, 431, 433, 439, 443
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 05 2003

Keywords

Comments

Same as primes with prime binary digit sum.
Primes with prime decimal digit sum are A046704.
Sum_{a(n) < x} 1/a(n) is asymptotic to log(log(log(x))) as x -> infinity; see Harman (2012). Thus the sequence is infinite. - Jonathan Sondow, Jun 09 2012
A049084(A000120(a(n))) > 0; A081091, A000215 and A081093 are subsequences.

Examples

			15th prime = 47 = '101111' with five 1's, therefore 47 is in the sequence.
		

Crossrefs

Subsequence of A052294.

Programs

  • Haskell
    a081092 n = a081092_list !! (n-1)
    a081092_list = filter ((== 1) . a010051') a052294_list
    -- Reinhard Zumkeller, Nov 16 2012
    
  • Maple
    q:= n-> isprime(n) and isprime(add(i,i=Bits[Split](n))):
    select(q, [$1..500])[];  # Alois P. Heinz, Sep 28 2023
  • Mathematica
    Clear[BinSumOddQ];BinSumPrimeQ[a_]:=Module[{i,s=0},s=0;For[i=1,i<=Length[IntegerDigits[a,2]],s+=Extract[IntegerDigits[a,2],i];i++ ];PrimeQ[s]]; lst={};Do[p=Prime[n];If[BinSumPrimeQ[p],AppendTo[lst,p]],{n,4!}];lst (* Vladimir Joseph Stephan Orlovsky, Apr 06 2009 *)
    Select[Prime[Range[100]], PrimeQ[Apply[Plus, IntegerDigits[#, 2]]] &] (* Jonathan Sondow, Jun 09 2012 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (isprime(hammingweight(p)), print1(p, ", ")););} \\ Michel Marcus, Jan 16 2015
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n.bit_count()) and isprime(n)
    print([k for k in range(444) if ok(k)]) # Michael S. Branicky, Dec 27 2023

A070027 Prime numbers whose initial, all intermediate and final iterated sums of digits are primes.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 83, 101, 113, 131, 137, 151, 173, 191, 223, 227, 241, 263, 281, 311, 313, 317, 331, 353, 401, 421, 443, 461, 599, 601, 641, 797, 821, 887, 911, 977, 1013, 1019, 1031, 1033, 1051, 1091, 1103, 1109, 1123, 1163, 1181, 1213
Offset: 1

Views

Author

Rick L. Shepherd, Apr 14 2002

Keywords

Comments

Subsequence of A046704; actually, exactly those numbers for which the orbit under A007953 is a subset of A046704. - M. F. Hasler, Jun 28 2009
Supersequences: A046704 is primes p with digit sum s(p) also prime; A207294 is primes p with s(p) and s(s(p)) also prime.
Disjoint sequences: A104213 is primes p with s(p) not prime; A207293 is primes p with s(p) also prime, but not s(s(p)); A213354 is primes p with s(p) and s(s(p)) also prime, but not s(s(s(p))); A213355 is smallest prime p with k-fold digit sum s(s(..s(p)..)) also prime for all k < n, but not for k = n. - Jonathan Sondow, Jun 13 2012

Examples

			599 is a term because 599, 5+9+9 = 23 and 2+3 = 5 are all prime. 2999 is a term because 2999, 2+9+9+9 = 29, 2+9 = 11 and 1+1 = 2 are all prime. See A062802 and A070026 for related comments.
		

Crossrefs

Cf. A070026 (a supersequence), subsequences: A062802, A070028, A070029.

Programs

  • Mathematica
    dspQ[n_] := TrueQ[Union[PrimeQ[NestWhileList[Plus@@IntegerDigits[#] &, n, # > 9 &]]] == {True}]; Select[Prime[Range[200]], dspQ] (* Alonso del Arte, Aug 17 2011 *)
    isdpQ[n_]:=AllTrue[Rest[NestWhileList[Total[IntegerDigits[#]]&,n,#>9&]],PrimeQ]; Select[Prime[Range[300]],isdpQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 12 2017 *)
  • PARI
    isA070027(n)={ while(isprime(n), n<9 && return(1); n=vector(#n=eval(Vec(Str(n))),i,1)*n~)} \\ M. F. Hasler, Jun 28 2009
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n) and (n < 10 or ok(sum(map(int, str(n)))))
    print([k for k in range(2, 1214) if ok(k)]) # Michael S. Branicky, May 22 2025

Formula

Prime p is a term if and only if p < 10 or A007953(p) is a term. - Michael S. Branicky, May 22 2025

A088136 Primes such that sum of first and last digits is prime.

Original entry on oeis.org

11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 131, 151, 181, 191, 211, 223, 229, 233, 239, 241, 251, 263, 269, 271, 281, 283, 293, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 601, 607, 617, 631, 641, 647, 661, 677, 691
Offset: 1

Views

Author

Zak Seidov, Sep 20 2003

Keywords

Crossrefs

Cf. A008040 (primes), A010051 (isprime), A000030 (first digit of n), A010879 (last digit of n).

Programs

  • Mathematica
    Select[Prime[Range[400]],PrimeQ[First[IntegerDigits[#]]+ Last[ IntegerDigits[ #]]]&] (* Harvey P. Dale, Jun 23 2017 *)
  • PARI
    select( {is_A088136(p)=isprime(p\10^logint(p,10)+p%10)&&isprime(p)}, primes(99)) \\ M. F. Hasler, Apr 23 2024
  • Python
    from sympy import isprime, primerange
    def ok(p): s = str(p); return isprime(int(s[0]) + int(s[-1]))
    def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
    print(aupto(691)) # Michael S. Branicky, Nov 23 2021
    

A062088 Primes with every digit a prime and the sum of the digits a prime.

Original entry on oeis.org

2, 3, 5, 7, 23, 223, 227, 337, 353, 373, 557, 577, 733, 757, 773, 2333, 2357, 2377, 2557, 2753, 2777, 3253, 3257, 3323, 3527, 3727, 5233, 5237, 5273, 5323, 5527, 7237, 7253, 7523, 7723, 7727, 22573, 23327, 25237, 25253, 25523, 27253, 27527, 32233, 32237, 32257
Offset: 1

Views

Author

Amarnath Murthy, Jun 16 2001

Keywords

Examples

			2357 is a prime, each digit is a prime and the sum of digits = 17 is also a prime, so 2357 is a term.
		

Crossrefs

Intersection of A019546 and A046704.

Programs

  • MATLAB
    prim=primes(1000000);
    m=1;
    for u=1:100;
        v=prim(u);
        nc=dec2base(v,10)-'0';
        s=sum(nc);
             if and(isprime(nc)==1,isprime(s)==1)
                 sol(m)=v;
                 m=m+1;
             end
    end
    sol; % Marius A. Burtea, Dec 08 2018
    
  • Mathematica
    aQ[p_] := PrimeQ[p] && Module[{d = IntegerDigits[p]}, PrimeQ[Total[d]] && LengthWhile[d, PrimeQ[#] &] == Length[d]]; Select[Range[33000], aQ] (* Amiram Eldar, Dec 08 2018 *)
  • PARI
    isok(p) = isprime(p) && isprime(sumdigits(p)) && (#select(x->(! isprime(x)), digits(p)) == 0); \\ Michel Marcus, Dec 08 2018
    
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen():
        yield from [2, 3, 5, 7]
        for d in count(2):
            for left in product("2357", repeat=d-1):
                for end in "37":
                    ts = "".join(left) + end
                    if isprime(sum(map(int, ts))):
                        t = int(ts)
                        if isprime(t): yield t
    print(list(islice(agen(), 46))) # Michael S. Branicky, Sep 23 2022

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jun 21 2001

A054750 Smallest prime number whose digits sum to n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 29, 67, 89, 199, 599, 2999, 4999, 29989, 59999, 79999, 389999, 989999, 6999899, 8989999, 59899999, 89999999, 289999999, 799999999, 3999998999, 19999997999, 79999999999, 399999998999, 599999899999, 999998999999
Offset: 1

Views

Author

G. L. Honaker, Jr., Apr 24 2000

Keywords

Comments

a(n) >= A051885(A000040(n)). Indices n for which the equality holds are listed in A055019.
a(n) >= A046864(n). - Michel Marcus, Nov 01 2015

Examples

			a(7)=89 because 8+9=17 and 17 is the 7th prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{k=2}, While[DigitSum[k]!=Prime[n], k=NextPrime[k]]; k]; Array[a,15] (* Stefano Spezia, Mar 27 2025 *)
  • PARI
    a(n) = {my(k=2); my(p=prime(n)); while((sumdigits(k) != prime(n)), k=nextprime(k+1)); k;} \\ Michel Marcus, Nov 01 2015

Extensions

More terms from Kok Seng Chua (chuaks(AT)ihpc.nus.edu.sg), May 31 2000
Edited and extended by Robert G. Wilson v, Feb 26 2002

A091366 Primes p such that the sum of the cubes of the digits of p is prime.

Original entry on oeis.org

11, 101, 113, 131, 139, 151, 193, 199, 223, 227, 241, 263, 269, 281, 283, 311, 337, 353, 359, 373, 421, 449, 461, 463, 487, 557, 577, 593, 599, 641, 643, 661, 733, 757, 821, 823, 827, 829, 883, 887, 919, 953, 991, 997, 1013, 1031, 1039, 1051, 1093, 1103, 1123
Offset: 1

Views

Author

Chuck Seggelin, Jan 03 2004

Keywords

Comments

Apparently, in most cases the sum of the digits of such primes is also prime, see A091365 for the exceptions.
I conjecture the contrary: the relative density of numbers in this sequence with prime digit sum is 0. - Charles R Greathouse IV, Sep 08 2010

Examples

			a(1)=11 because 1^3 + 1^3 = 2 which is prime. a(10)=227 because 2^3 + 2^3 + 7^3 = 359 which is prime.
		

Crossrefs

Cf. A046704 (primes whose digits sum to a prime) A052034 (primes whose digits squared sum to a prime) A091365 (primes whose digits cubed sum to a prime but whose digits do not sum to a prime).

Programs

  • Mathematica
    Select[Prime[Range[2, 200]], PrimeQ[Total[IntegerDigits[#]^3]]&] (* Vincenzo Librandi, Apr 13 2013 *)
  • PARI
    is(n)=my(v);if(!isprime(n),return(0));v=eval(Vec(Str(n)));isprime(sum(i=1,#v,v[i]^3)) \\ Charles R Greathouse IV, Sep 08 2010

Extensions

a(44) = 997 inserted by Charles R Greathouse IV, Sep 08 2010
Showing 1-10 of 62 results. Next