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

A192977 Number of times 9*n occurs in A068395.

Original entry on oeis.org

4, 4, 2, 2, 3, 2, 2, 3, 2, 1, 0, 4, 1, 1, 3, 1, 2, 2, 2, 1, 4, 0, 0, 1, 3, 2, 1, 2, 2, 2, 2, 1, 0, 1, 3, 0, 2, 2, 2, 1, 2, 2, 1, 0, 2, 1, 1, 3, 2, 1, 3, 1, 1, 2, 0, 2, 0, 2, 0, 2, 1, 2, 2, 1, 2, 0, 2, 3, 0, 1, 3, 2, 1, 2, 1, 1, 0, 2, 1, 1, 2, 1, 2, 2, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 04 2011

Keywords

Examples

			n=1: A068395(k) = 9 = 9*1, for k = 5,6,7,8 therefore a(1) = 4;
n=10: 90 = 9*10 doesn't occur in A068395, therefore a(10) = 0;
n=100: A068395(156) = A068395(157) = 900 = 9*100, therefore a(100) = 2.
		

Programs

  • Haskell
    import Data.List (group)
    a192977_list = f 0 $ group a068395_list where
       f n xss'@(xs:xss)
         | head xs `div` 9 == n = length xs : f (n+1) xss
         | otherwise            = 0 : f (n+1) xss'

A007605 Sum of digits of n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 2, 4, 8, 10, 5, 11, 4, 10, 5, 7, 11, 8, 14, 7, 13, 8, 10, 16, 11, 17, 16, 2, 4, 8, 10, 5, 10, 5, 11, 13, 14, 7, 13, 10, 14, 11, 17, 10, 11, 13, 17, 19, 4, 7, 11, 13, 8, 14, 7, 8, 14, 11, 17, 10, 16, 11, 13, 14, 10, 5, 7, 11, 7, 13, 14, 16, 11, 17, 16, 13, 19, 14, 20, 19, 5
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007605_list = map a007953 a000040_list -- Reinhard Zumkeller, Aug 04 2011
    
  • Magma
    [ &+Intseq(NthPrime(n), 10): n in [1..80] ]; // Klaus Brockhaus, Jun 13 2009
    
  • Maple
    map(t -> convert(convert(t,base,10),`+`), select(isprime, [2,(2*i+1 $ i=1..1000)])); # Robert Israel, Aug 16 2015
  • Mathematica
    Table[Apply[Plus, RealDigits[Prime[n]][[1]]], {n, 1, 100}]
    Plus@@ IntegerDigits[Prime[Range[100]]] (* Zak Seidov *)
  • PARI
    dsum(n)=my(s);while(n,s+=n%10;n\=10);s
    forprime(p=2,1e3,print1(dsum(p)", ")) \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    a(n) = sumdigits(prime(n)); \\ Michel Marcus, Dec 20 2017
    
  • Python
    from sympy import prime
    def a(n): return sum(map(int, str(prime(n))))
    print([a(n) for n in range(1, 80)]) # Michael S. Branicky, Feb 03 2021

Formula

a(n) = A007953(A000040(n)) = A007953(prime(n)).

A243442 Primes p such that, in base 2, p - digitsum(p) is also a prime.

Original entry on oeis.org

5, 23, 71, 83, 101, 113, 197, 281, 317, 353, 359, 373, 401, 467, 599, 619, 683, 739, 751, 773, 977, 1091, 1097, 1103, 1217, 1223, 1229, 1237, 1283, 1303, 1307, 1429, 1433, 1489, 1553, 1559, 1601, 1607, 1613, 1619, 1699, 1873, 1879, 2039, 2347, 2357, 2389
Offset: 1

Views

Author

Anthony Sand, Jun 05 2014

Keywords

Comments

In all bases b, x = n - digitsum(n) is always divisible by b-1, therefore x can be prime only in base 2 and bases b for which b-1 is prime. For example, in base 10, n - digitsum(n) is always divisible by 10 - 1 = 9 -- see A066568 and A068395. In base 8, 9 = 11, therefore 11 - digitsum(11) = 9 - 2 = 7 is divisible by 7.

Examples

			5 - digitsum(5,base=2) = 5 - digitsum(101) = 5 - 2 = 3.
23 - digitsum(10111) = 23 - 4 = 19.
71 - digitsum(1000111) = 71 - 4 = 67.
83 - digitsum(1010011) = 83 - 4 = 79.
101 - digitsum(1100101) = 101 - 4 = 97.
		

Crossrefs

Cf. A243441.

Programs

  • Mathematica
    Select[Prime[Range[400]],PrimeQ[#-Total[IntegerDigits[#,2]]]&] (* Harvey P. Dale, May 15 2019 *)
  • PARI
    isok(n) = isprime(n) && isprime(n - hammingweight(n)); \\ Michel Marcus, Jun 05 2014

A184328 Primes whose digital product is a positive square.

Original entry on oeis.org

11, 19, 41, 149, 191, 199, 229, 263, 281, 313, 331, 419, 433, 449, 491, 499, 661, 683, 797, 821, 829, 863, 881, 911, 919, 941, 977, 991, 1229, 1289, 1433, 1499, 1559, 1669, 1747, 1889, 1933, 1949, 1999, 2129, 2383, 2693, 2819, 2833, 2963, 3319, 3391, 3413
Offset: 1

Views

Author

Dario Piazzalunga, Dec 24 2012

Keywords

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(4000) | not IsZero(t) and IsSquare(t) where t is &*Intseq(p)]; // Bruno Berselli, Dec 25 2012
  • Mathematica
    fQ[n_] := Module[{d = Times @@ IntegerDigits[n]}, d > 0 && IntegerQ[Sqrt[d]]];Select[Prime[Range[1000]], fQ] (* T. D. Noe, Dec 24 2012 *)

Extensions

Corrected and extended by T. D. Noe, Dec 24 2012

A206011 The n-th semiprime minus its sum of digits.

Original entry on oeis.org

0, 0, 0, 9, 9, 9, 18, 18, 18, 18, 27, 27, 27, 27, 27, 36, 36, 45, 45, 45, 45, 54, 54, 54, 63, 63, 72, 72, 72, 72, 81, 81, 81, 81, 99, 108, 108, 108, 108, 117, 117, 117, 117, 126, 126, 135, 135, 135, 135, 135, 144, 144, 144, 153, 153, 153, 162, 162, 171, 171
Offset: 1

Views

Author

Jonathan Vos Post, Feb 02 2012

Keywords

Comments

This is to semiprimes A001358 as A068395 is to primes A000040. As with A068395, this is always a multiple of 9, hence cannot be prime. But, as happens first for a(4), a(n) can be semiprime.

Examples

			a(4) = 10 - 1 = 9.
a(5) = 14 - 5 = 9.
		

Crossrefs

Programs

  • Maple
    read("transforms") :
    A206011 := proc(n)
        s := A001358(n) ;
        s -digsum(s) ;
    end proc: # R. J. Mathar, Sep 14 2012
  • Mathematica
    #-Total[IntegerDigits[#]]&/@Select[Range[200],PrimeOmega[#]==2&] (* Harvey P. Dale, Nov 24 2022 *)

Formula

a(n) = A001358(n) - A007953(A001358(n)).

A321150 Primes p such that p minus its digit sum is a square.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 41, 43, 47, 97, 151, 157, 233, 239, 331, 337, 457, 593, 599, 743, 911, 919, 1301, 1303, 1307, 1531, 1783, 1787, 1789, 2039, 2311, 2617, 2939, 3613, 3617, 4373, 4783, 4787, 4789, 5641, 5647, 6581, 7079, 7591, 8111, 8117, 8677, 9239, 9829, 11681, 11689, 13001, 13003, 13007
Offset: 1

Views

Author

Marius A. Burtea, Oct 28 2018

Keywords

Examples

			11 is prime and 11 - (1+1) = 9 = 3^2 is square, so 11 is a term of the sequence.
457 is prime and 457 - (4+5+7) = 441 = 21^2 is square, so 457 is a term of the sequence.
2939 is prime and 2939 - (2+9+3+9) = 2916 = 54^2 is square, so 2939 is a term of the sequence.
101 is prime and 101 - (1+0+1) = 99 is not square, so 101 is not a term of the sequence.
		

Crossrefs

Intersection of A000040 and A066566.

Programs

  • Maple
    select(t -> isprime(t) and issqr(t - convert(convert(t,base,10),`+`)),
    [2,seq(i,i=3..20000,2)]); # Robert Israel, Apr 15 2019
  • Mathematica
    Select[Prime@ Range@ 2000, IntegerQ@ Sqrt[# - Total@ IntegerDigits@ #] &] (* Michael De Vlieger, Nov 05 2018 *)
  • PARI
    isok(p) = isprime(p) && issquare(p-sumdigits(p)); \\ Michel Marcus, Oct 30 2018

Extensions

a(26) corrected by Robert Israel, Apr 15 2019
Showing 1-6 of 6 results.