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

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)

A104213 Primes with nonprime sums of digits.

Original entry on oeis.org

13, 17, 19, 31, 37, 53, 59, 71, 73, 79, 97, 103, 107, 109, 127, 149, 163, 167, 181, 211, 233, 239, 251, 257, 271, 277, 293, 307, 347, 349, 367, 383, 389, 419, 431, 433, 439, 457, 479, 491, 499, 503, 509, 521, 523, 541, 547, 563, 569, 587, 613, 617, 619, 631
Offset: 1

Views

Author

Cino Hilliard, Mar 13 2005

Keywords

Comments

Primes with nonprime digital sums. [Juri-Stepan Gerasimov, Apr 23 2010]
Subsequence of primes of A104211. - Michel Marcus, May 03 2015

Examples

			Sum of digits of prime 13 = 4, which is not prime, so 13 is in the sequence.
		

Crossrefs

Cf. A046704 (primes with prime sums of digits), A104211.

Programs

  • Magma
    [p: p in PrimesUpTo(600) | not IsPrime(&+Intseq(p))]; // Vincenzo Librandi, May 03 2015
    
  • Mathematica
    Select[ Prime[ Range[115]], !PrimeQ[Plus @@ IntegerDigits[ # ]] &] (* Robert G. Wilson v, Mar 16 2005 *)
  • PARI
    select(p->!isprime(sumdigits(p)),primes(100)) \\ Joerg Arndt, May 03 2015

Extensions

Definition clarified by Jonathan Sondow, Jun 11 2012

A219110 Numbers for which at least one sum of two adjacent digits is not prime.

Original entry on oeis.org

10, 13, 15, 17, 18, 19, 22, 24, 26, 27, 28, 31, 33, 35, 36, 37, 39, 40, 42, 44, 45, 46, 48, 51, 53, 54, 55, 57, 59, 60, 62, 63, 64, 66, 68, 69, 71, 72, 73, 75, 77, 78, 79, 80, 81, 82, 84, 86, 87, 88, 90, 91, 93, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105
Offset: 1

Views

Author

M. F. Hasler, Apr 11 2013

Keywords

Comments

Different from A104211 where ("only") the sum of all digits is considered; of course exactly the two-digit terms coincide.
Numbers missing in A182177 and A182178. Otherwise said, complement of the range of A182177 (in the set of nonnegative integers) and of the range of A182178 (in the set of positive integers) and of A182175 in the set of integers > 9.

Examples

			102 is here because 1+0 is not prime (even though 0+2 is).
		

Programs

  • Mathematica
    Select[Range[10, 105], MemberQ[PrimeQ[Total /@ Partition[IntegerDigits[#], 2, 1]], False] &] (* T. D. Noe, Apr 16 2013 *)
  • PARI
    is(n)=for(i=2,#n=digits(n),isprime(n[i-1]+n[i])||return(1))

A228019 Composite numbers whose sum of digits is a composite number.

Original entry on oeis.org

4, 6, 8, 9, 15, 18, 22, 24, 26, 27, 28, 33, 35, 36, 39, 40, 42, 44, 45, 46, 48, 51, 54, 55, 57, 60, 62, 63, 64, 66, 68, 69, 72, 75, 77, 78, 80, 81, 82, 84, 86, 87, 88, 90, 91, 93, 95, 96, 99, 105, 108, 112, 114, 116, 117, 118, 121, 123, 125, 126, 129, 130, 132
Offset: 1

Views

Author

Derek Orr, Aug 02 2013

Keywords

Examples

			87 is a term: 87 and 8+7=15 are composite.
		

Crossrefs

Subsequence of A104211.

Programs

  • Magma
    [n: n in [4..200] | not IsPrime(n) and not IsPrime(&+Intseq(n))]; // Bruno Berselli, Aug 13 2013
  • PARI
    lista(N) = my(s); for(n=2,N, s=sumdigits(n); if(!isprime(n)&&!isprime(s)&&s>1, print1(n,", ") ) ) \\ Joerg Arndt, Aug 04 2013
    
  • PARI
    list(N)=my(v=List(),s); forcomposite(n=4,N,s=sumdigits(n); if(s>1 && !isprime(s), listput(v,n))); Vec(v)  \\ Charles R Greathouse IV, Aug 13 2013
    

A154679 Primes p such that the sum of digits of p+2 is a composite number.

Original entry on oeis.org

2, 7, 11, 13, 17, 29, 31, 37, 43, 53, 61, 67, 71, 73, 79, 89, 97, 101, 103, 107, 127, 139, 151, 157, 163, 167, 179, 181, 193, 211, 223, 229, 233, 241, 251, 257, 269, 271, 277, 283, 293, 307, 313, 331, 337, 347, 349, 359, 367, 373, 379, 383, 397, 409, 421, 431
Offset: 1

Views

Author

Giovanni Teofilatto, Jan 14 2009

Keywords

Comments

Primes p such that p+2 is in A104211. [R. J. Mathar, Jan 15 2009]

Crossrefs

Programs

  • Maple
    filter:= proc(n) local s;
    if not isprime(n) then return false fi;
    s:= convert(convert(n+2,base,10),`+`);
    s >= 4 and not isprime(s)
    end proc:
    select(filter, [$2..1000]); # Robert Israel, Mar 13 2019
  • Mathematica
    Select[Prime[Range[100]],CompositeQ[Total[IntegerDigits[#+2]]]&] (* Harvey P. Dale, Apr 28 2022 *)

Extensions

Extended by R. J. Mathar, Jan 15 2009

A228020 Composite numbers whose initial, all intermediate and final iterated digit sums are composite numbers.

Original entry on oeis.org

4, 6, 8, 9, 15, 18, 22, 24, 26, 27, 33, 35, 36, 40, 42, 44, 45, 51, 54, 60, 62, 63, 69, 72, 78, 80, 81, 87, 90, 96, 99, 105, 108, 112, 114, 116, 117, 121, 123, 125, 126, 130, 132, 134, 135, 141, 143, 144, 150, 152, 153, 159, 161, 162, 168, 170, 171, 177, 180, 186, 189, 195, 198, 202, 204, 206
Offset: 1

Views

Author

Derek Orr, Aug 02 2013

Keywords

Comments

a(n) is congruent to 0, 4, 6 or 8 mod 9. - Robert Israel, Aug 12 2014

Examples

			78 is a term because 78, 7+8 = 15, and 1+5 = 6 are composite.
		

Crossrefs

A subset of A228019 and A104211.

Programs

  • Maple
    filter:= proc(n) local x;
    x:= n;
    do
       if isprime(x) then return false fi;
       if x < 10 then return (x > 1) fi;
       x:= convert(convert(x,base,10),`+`);
    od:
    end proc;
    select(filter,[$4..1000]); # Robert Israel, Aug 12 2014
  • Mathematica
    okQ[n_] := n > 1 && !PrimeQ[n] && (n < 10 || okQ@ Total@ IntegerDigits@ n); Select[Range@168, okQ] (* Giovanni Resta, Aug 05 2013 *)
    cnQ[n_]:=AllTrue[NestWhileList[Total[IntegerDigits[#]]&,n,#>9&], CompositeQ]; Select[Range[210],cnQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 25 2016 *)
  • PARI
    forcomposite(n=1,500,s=sumdigits(n);while(s>9&&!isprime(s)&&s!=1,s=sumdigits(s));if(!isprime(s)&&s!=1,print1(n,", "))) \\ Derek Orr, Aug 12 2014

A267430 Squares whose digit sum is not a prime.

Original entry on oeis.org

0, 1, 4, 9, 36, 64, 81, 100, 121, 144, 169, 196, 225, 324, 361, 400, 441, 484, 529, 576, 729, 900, 961, 1089, 1225, 1296, 1521, 1681, 1764, 1849, 2025, 2116, 2304, 2601, 2916, 3025, 3249, 3364, 3481, 3600, 3969, 4356, 4489, 4624, 4761, 5041, 5184, 5476, 5625
Offset: 1

Views

Author

Vincenzo Librandi, Jan 15 2016

Keywords

Comments

Complement of A065408.
Includes A016766. - Robert Israel, Jan 15 2016

Crossrefs

Programs

  • Magma
    [n^2: n in [0..80] | not IsPrime(&+Intseq(n^2))];
    
  • Maple
    remove(t->isprime(convert(convert(t,base,10),`+`)), [seq(i^2,i=0..100)]); # Robert Israel, Jan 15 2016
  • Mathematica
    Select[Range[0,100]^2, ! PrimeQ[Total[IntegerDigits[#]]] &]
  • PARI
    is(n) = issquare(n) && !ispseudoprime(sumdigits(n)); \\ Altug Alkan, Jan 15 2016

Extensions

a(1)=0 prepended by Altug Alkan Jan 15 2016
Edited by Bruno Berselli, Jan 15 2016
Showing 1-7 of 7 results.