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.

Previous Showing 21-30 of 34 results. Next

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

A344825 Integers whose digit sum is prime and whose digit product is a perfect square > 0.

Original entry on oeis.org

11, 14, 41, 49, 94, 111, 119, 122, 128, 133, 155, 166, 182, 188, 191, 199, 212, 218, 221, 229, 236, 263, 281, 289, 292, 298, 313, 326, 331, 362, 368, 386, 449, 494, 515, 551, 559, 595, 616, 623, 632, 638, 661, 683, 779, 797, 812, 818, 821, 829, 836, 863, 881
Offset: 1

Views

Author

Ryan Bresler, May 29 2021

Keywords

Comments

If k is in the sequence then all anagrams of k are in the sequence. - David A. Corneth, May 29 2021
Trivially, this sequence has infinite elements. A031974 is an infinite sequence that is found in this sequence - Ryan Bresler, May 30 2021

Examples

			11 is a term because its digit sum is 2 (prime) and its digit product is 1 (perfect square > 0).
		

Crossrefs

Intersection of A028834 and A050626.
Subsequence of A052382.
A031974 is a subsequence of this sequence.

Programs

  • Maple
    q:= n-> (l-> not 0 in l and isprime(add(i, i=l)) and
             issqr(mul(i, i=l)))(convert(n, base, 10)):
    select(q, [$0..999])[];  # Alois P. Heinz, May 29 2021
  • Python
    from math import prod
    from sympy import isprime, integer_nthroot
    def ok(n):
      d = list(map(int, str(n)))
      return 0 not in d and isprime(sum(d)) and integer_nthroot(prod(d), 2)[1]
    print(list(filter(ok, range(1000)))) # Michael S. Branicky, May 29 2021

A084995 Numbers which can be written as the product of two different primes and the sum of digits is also prime.

Original entry on oeis.org

14, 21, 34, 38, 58, 65, 74, 85, 94, 106, 111, 115, 119, 122, 133, 142, 146, 155, 166, 201, 203, 205, 209, 214, 218, 221, 247, 254, 265, 274, 278, 287, 298, 302, 319, 326, 335, 346, 355, 362, 371, 377, 382, 386, 391, 395, 403, 407, 427, 445, 454, 458, 469, 478, 481, 485
Offset: 1

Views

Author

Meenakshi Srikanth (menakan_s(AT)yahoo.com), Jun 30 2003

Keywords

Examples

			E.g., 14 = 7*2 and 1+4 = 5 is also prime.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=60},Select[Union[Times@@@Subsets[Prime[Range[nn]],{2}]],PrimeQ[ Total[ IntegerDigits[#]]]&&#<=2Prime[nn]&]] (* Harvey P. Dale, Feb 28 2022 *)
  • PARI
    is(n)={bigomega(n)==2 && !issquare(n) && isprime(sumdigits(n))}
    select(is, [1..500]) \\ Andrew Howroyd, Jan 05 2020

Formula

Intersection of A028834 and A006881. - Andrew Howroyd, Jan 05 2020

Extensions

Terms a(14) and beyond from Andrew Howroyd, Jan 05 2020

A129630 Numbers k such that sum of digits of (k+1) is a prime.

Original entry on oeis.org

1, 2, 4, 6, 10, 11, 13, 15, 19, 20, 22, 24, 28, 29, 31, 33, 37, 40, 42, 46, 48, 49, 51, 55, 57, 60, 64, 66, 69, 73, 75, 82, 84, 88, 91, 93, 97, 100, 101, 103, 105, 109, 110, 112, 114, 118, 119, 121, 123, 127, 130, 132, 136, 138, 139, 141, 145, 147, 150, 154, 156, 159
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    P:=proc(n) local i,k,w; for i from 1 by 1 to n do w:=0; k:=binomial(i+1,i); while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; if isprime(w) then print(i); fi; od; end: P(1000);
  • Mathematica
    Select[Range[200], PrimeQ[Total[IntegerDigits[# + 1]]] &]

Formula

a(n) = A028834(n) - 1.

A167631 Emirps A006567 with a sum of digits and a number of digits which are both primes.

Original entry on oeis.org

113, 157, 179, 199, 311, 337, 359, 733, 739, 751, 937, 953, 971, 991, 10039, 10079, 10091, 10253, 10273, 10321, 10343, 10453, 10457, 10459, 10499, 10613, 10639, 10651, 10781, 10853, 10859, 10891, 10909, 11003, 11083, 11159, 11197, 11243
Offset: 1

Views

Author

Claudio Meller, Nov 07 2009

Keywords

Comments

Subsequence of A006567 and A028834. - R. J. Mathar, Nov 12 2009

Examples

			113 and 311 are distinct primes, and 3 (number of digits) and 5 (1+1+3) are also primes.
		

Programs

  • PARI
    sod(n)=my(s=0);while(n>9,s+=n%10;n\=10);s+n
    R(n)=my(v=eval(Vec(Str(n))),s=0);forstep(i=#v,1,-1,s=10*s+v[i]);s
    isA167631(n)=my(r); isprime(#Str(n)) && isprime(sod(n)) && isprime(n) && isprime(r=R(n)) && n!=r \\ Charles R Greathouse IV, Nov 10 2009
    
  • Python
    from sympy import primerange, isprime
    A167631 =[]
    for power_of_ten in [2,3,5]: # (7 can be added (12 sec. and 26790 terms), 11 not recommended)
        primes = list(primerange(10**(power_of_ten-1),10**power_of_ten))
        for p in primes:
            if str(p) != (p_rev:=str(p)[::-1]):
                if isprime(int(p_rev)):
                    if isprime(sum(list(map(int, p_rev.strip())))): A167631.append(p)
    print(A167631) # Karl-Heinz Hofmann, Feb 19 2025

Extensions

Edited by Charles R Greathouse IV and R. J. Mathar, Nov 10 2009

A295389 Numbers whose sum of digits is squarefree.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 12, 14, 15, 16, 19, 20, 21, 23, 24, 25, 28, 29, 30, 32, 33, 34, 37, 38, 41, 42, 43, 46, 47, 49, 50, 51, 52, 55, 56, 58, 59, 60, 61, 64, 65, 67, 68, 69, 70, 73, 74, 76, 77, 78, 82, 83, 85, 86, 87, 89, 91, 92, 94, 95, 96, 98, 100, 101, 102, 104, 105, 106, 109, 110, 111, 113, 114
Offset: 1

Views

Author

Nile Nepenthe Wynar, Nov 21 2017

Keywords

Comments

Numbers k such that A007953(k) is a term of A005117. - Felix Fröhlich, Nov 21 2017

Crossrefs

Cf. A005117, A007953. Includes A028834.

Programs

  • Maple
    select(n -> numtheory:-issqrfree(convert(convert(n,base,10),`+`)), [$1..200]); # Robert Israel, Nov 21 2017
  • PARI
    is(n) = issquarefree(sumdigits(n));
    for(n = 1, 200, if(is(n), print1(n,", ")))

A355017 a(n) is the number of bases in 2..n in which the sum of the digits of n is prime.

Original entry on oeis.org

0, 1, 1, 3, 4, 4, 3, 5, 6, 7, 7, 8, 7, 8, 5, 11, 9, 10, 8, 13, 8, 12, 9, 13, 11, 12, 10, 15, 11, 16, 10, 17, 10, 20, 12, 20, 14, 18, 13, 21, 13, 22, 13, 20, 14, 25, 14, 22, 18, 22, 15, 26, 12, 29, 17, 25, 15, 27, 15, 30, 19, 26, 14, 32, 17, 33, 19, 27, 19, 31, 18, 34, 19, 29, 19, 37, 16, 33, 21, 30, 24, 39, 20, 38
Offset: 2

Views

Author

Samuel Harkness, Jun 15 2022

Keywords

Comments

The graph of (n,a(n)) shows an interesting structure, somewhat resembling a comet with four tails. Starting at the bottom tail and going upwards:
Observations:
The bottom "tail" contains all n with both 2 and 3 as prime factors, i.e., numbers n in A008588 (1/6 of all n).
The second "tail" contains all n with 2 as a prime factor but not 3, i.e., numbers n in A047235 (1/3 of all n).
The third "tail" contains all n with 3 as a prime factor but 2, i.e., numbers n in A016945 (1/6 of all n).
The top "tail" contains all n with neither 2 nor 3 as a prime factor, i.e., numbers n in A007310 (1/3 of all n).
The bottom of each "tail" contains n with 5 as a prime factor. Moving up within each "tail," the prime factors of each n tend to increase.

Examples

			For n=7, express 7 in all bases from 2 to 7, then add the numbers, counting those which are prime:
  base 2: 1 1 1 --> 1+1+1=3 prime
  base 3: 2 1   --> 2+1=3   prime
  base 4: 1 3   --> 1+3=4   nonprime
  base 5: 1 2   --> 1+2=3   prime
  base 6: 1 1   --> 1+1=2   prime
  base 7: 1     --> 1=1     nonprime
The sum of the digits of the base-b expansion of 7 in 4 different bases b (2, 3, 5, and 6) from base 2 to 7 is prime, so a(7)=4.
		

Crossrefs

Programs

A372897 Count of n-digit numbers whose sum of digits is a prime.

Original entry on oeis.org

4, 33, 303, 2670, 23741, 222638, 2211826, 22325173, 220321667, 2128051302, 20606839279, 203631013986, 2048538361591, 20655036405780, 205672896661755, 2012878671315492, 19505453673514959, 190027534666354756, 1884928265282803982, 19032829919297816897, 193085599933330233795
Offset: 1

Views

Author

Antoine Mathys, May 15 2024

Keywords

Comments

a(n) is the number of terms in A028834 with n digits.
Sum of digits s in n digits is a composition of s into n parts the first of which ranges 1 to 9 and the rest 0 to 9. The number of such compositions is the coefficient of x^s in polynomial (x^1 + ... + x^9)*(x^0 + ... + x^9)^(n-1) and a(n) is the sum of those coefficients where s is prime. - Kevin Ryde, May 19 2024
a(554) is the first term for which number_of_digits(a(n)) != n. - Antoine Mathys, May 22 2024

Examples

			For n=1 the a(1)=4 numbers are 2,3,5,7.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[Coefficient[Sum[x^i,{i,9}]Sum[x^i,{i,0,9}]^(n-1),x^i],{i,Prime[Range[PrimePi[9n]]]}]; Array[a,21] (* Stefano Spezia, May 16 2024 *)
  • PARI
    a(n)=my(p=sum(i=1,9,x^i)*sum(i=0,9,x^i)^(n-1),s=0);forprime(q=2,9*n,s+=polcoef(p,q));s;

Extensions

a(12)-a(21) from Stefano Spezia, May 16 2024

A162250 Values of the form prime(prime(i)) with a prime digital sum.

Original entry on oeis.org

3, 5, 11, 41, 67, 83, 157, 179, 191, 241, 283, 331, 353, 401, 461, 599, 739, 773, 797, 919, 991, 1031, 1217, 1297, 1433, 1471, 1499, 1523, 1723, 1741, 1787, 2027, 2063, 2081, 2221, 2269, 2351, 2609, 2647, 2683, 2719, 2803, 3019, 3109, 3169, 3259, 3299
Offset: 1

Views

Author

Cino Hilliard, Jun 28 2009

Keywords

Examples

			Prime(prime(6)) = 41. 4+1=5, prime. So 41 is in the sequence.
		

Crossrefs

Intersection of A006450 and A028834.

Programs

  • PARI
    sodip(n) = {
    local(s=0,a,x,y,j,p);
    for(x=1,n, p=prime(prime(x)); a=eval(Vec(Str(p))); y=sum(j=1,length(a),a[j]); if(isprime(y),print1(p","));)
    }

Formula

{A006450(i) : A007953(A006450(i)) in A000040}. [From R. J. Mathar, Aug 03 2009]

Extensions

Definition rephrased by R. J. Mathar, Sep 11 2009

A162253 Smallest value of the n-fold nesting prime(prime(...(k)...)) with a prime digital sum.

Original entry on oeis.org

2, 3, 5, 11, 1787, 5381, 5381, 5381, 648391, 648391, 414507281407, 414507281407
Offset: 1

Views

Author

Cino Hilliard, Jun 29 2009

Keywords

Comments

n-deep nestings prime(prime(...(prime(k))...)) = prime^n(k) can be arranged in a table T(n,k),
2 3 5 7 11 13 : A000040, n=0
3 5 11 17 31 41 : A006450, n=1
5 11 31 59 127 179 : A038580, n=2
11 31 127 277 709 1063 : A049090
31 127 709 1787 5381 8527 : A049203
127 709 5381 15299 52711 87803 : A049202
a(n) is the leftmost value in the n-th row (the one with the smallest k) with a digit sum which is prime.
In order to generate the entries a(11) and a(12), prime2() was used which reads a large 880 gigabyte file of all primes < 10^12.

Examples

			1st nesting is prime(1) = 2 which has a prime digit sum: a(0). The second nesting is prime(prime(1)) = 3, which has a prime digits sum: a(1)=3. The 3rd and 4th nesting also succeed for k=1 while the fifth nesting prime(prime(prime(prime(prime(4))))) = 1787 is the first occurrence of sum of digits is prime. Here nesting for k = 1,2,3 does not sum to a prime number.
		

Programs

  • PARI
    for(j=1,12,print(j","sodip2(100,j)","));
    sodip2(n,m) = \\multiple nesting of prime(prime(prime..(n)
    {
    local(s=0,a,x,y,j,p);
    for(x=1,n,
    for(i=1,m,p=prime2(p));
    a=eval(Vec(Str(p)));
    y=sum(j=1,length(a),a[j]);
    if(isprime(y),return(p));
    )
    }

Formula

{min A000040^n(k): A000040^n(k) in A028834}. - R. J. Mathar, Jul 16 2009

Extensions

Definition rephrased by R. J. Mathar, Jul 16 2009
Previous Showing 21-30 of 34 results. Next