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

A046704 Additive primes: sum of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 23, 29, 41, 43, 47, 61, 67, 83, 89, 101, 113, 131, 137, 139, 151, 157, 173, 179, 191, 193, 197, 199, 223, 227, 229, 241, 263, 269, 281, 283, 311, 313, 317, 331, 337, 353, 359, 373, 379, 397, 401, 409, 421, 443, 449, 461, 463, 467, 487, 557, 571, 577, 593
Offset: 1

Views

Author

Keywords

Comments

Sum_{a(n) < x} 1/a(n) is asymptotic to (3/2)*log(log(log(x))) as x -> infinity; see Harman (2012). Thus the sequence is infinite. - Jonathan Sondow, Jun 07 2012
Harman 2012 also shows, under a conjecture about primes in short intervals, that there are 3/2 * x/(log x log log x) terms up to x. - Charles R Greathouse IV, Nov 17 2014

Examples

			The digit sums of 11 and 13 are 1+1=2 and 1+3=4. Since 2 is prime and 4 is not, 11 is a member and 13 is not. - _Jonathan Sondow_, Jun 07 2012
		

Crossrefs

Indices of additive primes are in A075177.
Cf. A046703, A119450 = Primes with odd digit sum, A081092 = Primes with prime binary digit sum, A104213 = Primes with nonprime digit sum.
Cf. A007953, A010051; intersection of A028834 and A000040.

Programs

  • Haskell
    a046704 n = a046704_list !! (n-1)
    a046704_list = filter ((== 1) . a010051 . a007953) a000040_list
    -- Reinhard Zumkeller, Nov 13 2011
  • Magma
    [ p: p in PrimesUpTo(600) | IsPrime(&+Intseq(p)) ];  // Bruno Berselli, Jul 08 2011
    
  • Maple
    select(n -> isprime(n) and isprime(convert(convert(n,base,10),`+`)), [2,seq(2*i+1,i=1..1000)]); # Robert Israel, Nov 17 2014
  • Mathematica
    Select[Prime[Range[100000]], PrimeQ[Apply[Plus, IntegerDigits[ # ]]]&]
  • PARI
    isA046704(n)={local(s,m);s=0;m=n;while(m>0,s=s+m%10;m=floor(m/10));isprime(n) & isprime(s)} \\ Michael B. Porter, Oct 18 2009
    
  • PARI
    is(n)=isprime(n) && isprime(sumdigits(n)) \\ Charles R Greathouse IV, Dec 26 2013
    

A172216 Smallest k such that sum of digits of prime(n)^k is prime.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Jan 29 2010

Keywords

Comments

For all n, prime(n)^0 = 1 has nonprime sum of digits 1.
a(n) = 1 iff prime(n) is in A046704, an additive prime. a(n) = 1 iff n is in A075177.

Examples

			prime(1) = 2; 2^1 = 2 has prime sum of digits 2. Hence a(1) = 1.
prime(6) = 13; 13^1 = 13 has nonprime sum of digits 4; 13^2 = 169 has nonprime sum of digits 16; 13^3 = 2197 has prime sum of digits 19. Hence a(6) = 3.
		

Crossrefs

Programs

  • Magma
    S:=[]; for n in [1..105] do j:=1; while not IsPrime(&+Intseq(NthPrime(n)^j)) do j+:=1; end while; Append(~S, j); end for; S;
  • Mathematica
    sdp[n_]:=Module[{k=1},While[!PrimeQ[Total[IntegerDigits[Prime[n]^k]]], k++]; k]; Array[sdp,110] (* Harvey P. Dale, Apr 13 2014 *)

A346489 a(n) is the index of the smallest prime whose digits sum to n-th prime.

Original entry on oeis.org

1, 2, 3, 4, 10, 19, 24, 46, 109, 430, 669, 3245, 6057, 7837, 33067, 77777, 476643, 601855, 3556550, 5216954, 15739663, 41146179, 189961757, 882206624, 3325059246, 15581005618, 23007498153, 37607875618
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 19 2021

Keywords

Examples

			a(10) = 430 because prime(430) = 2999, 2 + 9 + 9 + 9 = 29 = prime(10) and this is the smallest such number.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=522*10^4,tbl},tbl=Table[{n,Total[IntegerDigits[Prime[n]]]},{n,nn}];Table[SelectFirst[tbl,#[[2]]==Prime[n]&],{n,20}]][[;;,1]] (* The program generates the first 20 terms of the sequence. *) (* Harvey P. Dale, Feb 19 2023 *)

Formula

a(n) = A000720(A054750(n)).
a(n) = min {k : A007605(k) = prime(n)}.
Showing 1-3 of 3 results.