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

A174910 Partial sums of A028835.

Original entry on oeis.org

2, 5, 10, 17, 28, 40, 54, 70, 90, 111, 134, 159, 188, 218, 250, 284, 322, 361, 402, 445, 492, 540, 590, 642, 698, 755, 814, 875, 940, 1006, 1074, 1144, 1218, 1293, 1370, 1449, 1532, 1616, 1702, 1790, 1882, 1975, 2070, 2167, 2268, 2370, 2474, 2580, 2690, 2801
Offset: 1

Views

Author

Jonathan Vos Post, Apr 01 2010

Keywords

Crossrefs

Cf. A028835.

Formula

a(n) = Sum{i=1..n} A028835(i).

Extensions

a(37) corrected by Georg Fischer, Aug 28 2020

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)

A028843 Numbers whose iterated product of digits is a prime.

Original entry on oeis.org

2, 3, 5, 7, 12, 13, 15, 17, 21, 26, 31, 34, 35, 37, 43, 51, 53, 57, 62, 71, 73, 75, 112, 113, 115, 117, 121, 126, 131, 134, 135, 137, 143, 151, 153, 157, 162, 171, 173, 175, 211, 216, 223, 232, 261, 278, 279, 287, 297, 299, 311, 314, 315, 317, 322, 341, 351, 355
Offset: 1

Views

Author

Keywords

Examples

			For 53, the product of digits is 5 * 3 = 15, iterated to 1 * 5 = 5, which is a prime, so 53 is in the sequence.
For 54, the product of digits is 5 * 4 = 20, iterated to 2 * 0 = 0, which is not prime, so 54 is not in the sequence.
		

Crossrefs

Programs

  • Mathematica
    iterDigitProd[n_] := NestWhile[Times@@IntegerDigits[#] &, n, # > 9 &]; Select[Range[355], PrimeQ[iterDigitProd[#]] &] (* Jayanta Basu, Jun 02 2013 *)
  • Scala
    def iterDigitProd(n: Int): Int = n.toString.length match {
      case 1 => n
      case  => iterDigitProd(n.toString.toCharArray.map( - 48).scanRight(1)( * ).head)
    }
    (1 to 400).filter(n => List(2, 3, 5, 7).contains(iterDigitProd(n))) // Alonso del Arte, Apr 11 2020

Extensions

More terms from Patrick De Geest, Jun 15 1999
Corrected by Franklin T. Adams-Watters, Jan 17 2007

A070026 Initial, all intermediate and final iterated sums of digits of n are primes.

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, 50, 52, 56, 61, 65, 70, 74, 83, 92, 101, 102, 104, 106, 110, 111, 113, 115, 119, 120, 122, 124, 128, 131, 133, 137, 140, 142, 146, 151, 155, 160, 164, 173, 182, 191, 200, 201, 203, 205, 209, 210, 212, 214, 218
Offset: 1

Views

Author

Rick L. Shepherd, Apr 13 2002

Keywords

Comments

2999 = A062802(4) is the smallest term of this sequence for which the second iterated sum of digits is not the final sum; i.e. the smallest requiring three summations (2+9+9+9=29, 2+9=11, 1+1=2 and all three sums are prime). (The corresponding statement about the very large A062802(5) is not true because a large number of smaller nonprimes of the same digit length also have the digit sum 2999, the least being 29999..., where 333 9's follow the 2.). A062802, a sequence of primes, is a subsequence of this sequence and of A070027.
Additional terms can be generated by finding the next number whose digit sum is a prime already in the sequence. - Felix Fröhlich, Jun 13 2014

Examples

			47 is here because 4+7=11 and 11 is prime while also 1+1=2 and 2 is prime. 39 (in A028835) is not a term: 3+9=12 is not prime - although 1+2=3 is prime. 49 (in A028834) is not a term: 4+9=13 is prime but 1+3=4 is not prime.
		

Crossrefs

Cf. A028834 (Initial sum is prime), A028835 (Final sum is prime), A062802, A070027 (Primes from this sequence).

Extensions

Terms corrected by Felix Fröhlich, Jun 13 2014

A226186 Composite numbers with both additive and multiplicative digital roots prime.

Original entry on oeis.org

12, 21, 34, 57, 75, 115, 232, 299, 322, 371, 376, 398, 511, 579, 597, 637, 713, 731, 736, 759, 763, 795, 893, 938, 957, 975, 992, 1112, 1121, 1137, 1157, 1173, 1175, 1211, 1299, 1317, 1355, 1371, 1389, 1398, 1469, 1474, 1496, 1517, 1535, 1649, 1694
Offset: 1

Views

Author

Jayanta Basu, Jun 03 2013

Keywords

Examples

			322 is here since for 322 additive digital root is 7 and multiplicative digital root is 2, both are primes.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := NestWhile[Times@@IntegerDigits[#]&, n, #>9&]; Select[Range[1700], !PrimeQ[#] && And@@PrimeQ[{a[#], Mod[#,9]}]&]
Showing 1-5 of 5 results.