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 11-20 of 92 results. Next

A090431 Difference between sums of digits of n and n-th prime.

Original entry on oeis.org

-1, -1, -2, -3, 3, 2, -1, -2, 4, -10, -2, -7, -1, -2, -5, -1, -6, 2, -3, -6, -7, -12, -6, -11, -9, 6, 5, 2, 1, -2, -6, 0, -5, -6, -6, 2, -3, 1, -2, -7, -12, -4, -4, -5, -8, -9, 7, 5, 2, -8, -2, -7, 1, 1, -4, 0, -5, 3, -2, -5, -6, -6, -1, 5, 4, 1, 6, 1, 1, -9, -3, -8, -6, -2
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 01 2003

Keywords

Comments

a(n) = A007953(n) - A007605(n);
a(A033549(n))=a(A049084(A033548(n)))=0; a(A049084(A090432(n)))<0; a(A049084(A090433(n)))>0.

Crossrefs

Cf. A239324 (partial sums).

Programs

A239619 Base 3 sum of digits of prime(n).

Original entry on oeis.org

2, 1, 3, 3, 3, 3, 5, 3, 5, 3, 3, 3, 5, 5, 5, 7, 5, 5, 5, 7, 5, 7, 3, 5, 5, 5, 5, 7, 3, 5, 5, 7, 5, 5, 7, 7, 7, 3, 5, 5, 7, 5, 5, 5, 7, 5, 7, 7, 7, 7, 9, 9, 9, 5, 5, 5, 7, 3, 5, 5, 5, 7, 5, 7, 7, 7, 5, 5, 7, 7, 5, 7, 7, 7, 5, 7, 7, 7, 9, 5, 7, 7, 9, 5, 7, 7, 9
Offset: 1

Views

Author

Tom Edgar, Mar 22 2014

Keywords

Examples

			The fifth prime is 11, 11 in base 3 is (1,0,2) so a(5)=1+0+2=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),3): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 3], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = vecsum(digits(prime(n), 3)); \\ Michel Marcus, Mar 07 2020
  • Sage
    [sum(i.digits(base=3)) for i in primes_first_n(200)]
    

Formula

a(n) = A053735(A000040(n)).

A239690 Base 4 sum of digits of prime(n).

Original entry on oeis.org

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

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-4 dominance order on the natural numbers.

Examples

			The sixth prime is 13, 13 in base 4 is (3,1) so a(6)=3+1=4.
		

Crossrefs

Programs

  • Haskell
    a239690 = a053737 . a000040  -- Reinhard Zumkeller, Mar 20 2015
  • Magma
    [&+Intseq(NthPrime(n),4): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 4], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • Sage
    [sum(i.digits(base=4)) for i in primes_first_n(200)]
    

Formula

a(n) = A053737(A000040(n)).

A230199 Sum of digits of n-th palindromic prime.

Original entry on oeis.org

2, 3, 5, 7, 2, 2, 5, 7, 10, 11, 7, 11, 13, 14, 16, 19, 22, 23, 19, 20, 5, 7, 8, 7, 8, 10, 13, 14, 11, 16, 17, 13, 17, 16, 17, 14, 17, 19, 20, 20, 25, 19, 22, 23, 28, 29, 7, 8, 10, 13, 14, 8, 13, 13, 14, 17, 19, 22, 16, 17, 19, 23, 20, 23, 22, 25, 22, 23, 29
Offset: 1

Views

Author

Shyam Sunder Gupta, Oct 11 2013

Keywords

Examples

			a(6) =2, since sum of digits of 6th palindromic prime i.e. 101 is 2.
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[z = n*10^(IntegerLength[n] - 1) +
    FromDigits@Rest@Reverse@IntegerDigits[n]; If[PrimeQ[z], s = Apply[Plus, IntegerDigits[z]]; AppendTo[a, s]], {n, 1, 10^5}]; Insert[a, 2, 5]
    palQ[n_]:=Module[{idn=IntegerDigits[n]},idn==Reverse[idn]]; Total[ IntegerDigits[ #]]&/@ Select[Prime[Range[5000]],palQ] (* Harvey P. Dale, Oct 10 2014 *)

Formula

a(n) = A007953(A002385(n)). - R. J. Mathar, Sep 09 2015

A042939 Absolute values between digits of primes.

Original entry on oeis.org

2, 3, 5, 7, 0, 2, 6, 8, 1, 7, 2, 4, 3, 1, 3, 2, 4, 5, 1, 6, 4, 2, 5, 1, 2, 0, 2, 6, 8, 3, 8, 3, 9, 11, 12, 5, 11, 8, 12, 9, 15, 8, 9, 11, 15, 17, 0, 3, 7, 9, 4, 10, 3, 4, 10, 7, 13, 6, 12, 7, 9, 10, 4, 1, 1, 5, 1, 7, 8, 10, 5, 11, 10, 7, 13, 8, 14, 13, 3, 5, 6, 1, 0, 2, 8, 3, 9, 8, 3, 5, 9, 12, 11, 6
Offset: 1

Views

Author

Keywords

Comments

a(n) = absolute difference between the first digit of prime(n) and the sum of the other digits of prime(n). [Harvey P. Dale, Mar 11 2012]

Crossrefs

Programs

  • Haskell
    a042939 = a040997 . a000040
    -- Reinhard Zumkeller, Oct 10 2012
  • Mathematica
    ddp[n_]:=Module[{idn=IntegerDigits[n]},Abs[First[idn]-Total[Rest[idn]]]]; ddp/@Prime[Range[100]] (* Harvey P. Dale, Mar 11 2012 *)

Formula

If decimal expansion of n-th prime is x1 x2 x3......xk then a(n)=|x1-x2-x3.......-xk|
a(n) = A040997(A000040(n)). - Reinhard Zumkeller, Oct 10 2012

A067523 The smallest prime with a possible given digit sum.

Original entry on oeis.org

2, 3, 13, 5, 7, 17, 19, 29, 67, 59, 79, 89, 199, 389, 499, 599, 997, 1889, 1999, 2999, 4999, 6899, 17989, 8999, 29989, 39989, 49999, 59999, 79999, 98999, 199999, 389999, 598999, 599999, 799999, 989999, 2998999, 2999999, 4999999, 6999899, 8989999
Offset: 1

Views

Author

Amarnath Murthy, Feb 14 2002

Keywords

Comments

Except for 3 no other prime has a digit sum which is a multiple of 3. Hence the possible digit sums are 2,3,4,5,7,8,10,11,13,14,16,..., etc. Conjecture: For every possible digit sum there exists a prime.
For n > 2, this is (conjecturally) the smallest prime with digit sum A001651(n). - Lekraj Beedassy, Mar 04 2009

Crossrefs

Cf. A001651. Equals A067180 with the 0 terms removed.

Programs

  • Maple
    g:= proc(s, d) # integers of <=d digits with sum s
      local j;
      if s > 9*d then return [] fi;
      if d = 1 then return [s] fi;
      [seq(op(map(t -> j*10^(d-1)+ t, procname(s-j, d-1))), j=0..9)];
    end proc:
    f:= proc(n) local d, j, x, y;
      if n mod 3 = 0 then return 0 fi;
      for d from ceil(n/9) do
        if d = 1 then
          if isprime(n) and n < 10 then return n
          else next
        fi fi;
        for j from 1 to 9 do
           for y in g(n-j, d-1) do
             x:= 10^(d-1)*j + y;
             if isprime(x) then return x fi;
      od od od;
    end proc:
    f(3):= 3:
    map(f, [2,3,seq(seq(3*i+j,j=1..2),i=1..30)]); # Robert Israel, Jan 18 2024
  • PARI
    A067523(n)=if(n<3,n+1,A067180(n*3\/2-1)) \\ M. F. Hasler, Nov 04 2018

Formula

a(n) = min(prime(i): A007605(i) = A133223(i)). - R. J. Mathar, Nov 06 2018

Extensions

More terms from Vladeta Jovovic, Feb 18 2002
Edited by Ray Chandler, Apr 24 2007

A073867 Smallest prime whose digital sum is equal to the n-th composite number, or 0 if no such prime exists.

Original entry on oeis.org

13, 0, 17, 0, 19, 0, 59, 0, 79, 0, 389, 0, 499, 0, 997, 1889, 0, 1999, 0, 6899, 0, 17989, 8999, 0, 39989, 0, 49999, 0, 98999, 0, 199999, 0, 598999, 599999, 0, 799999, 0, 2998999, 2999999, 0, 4999999, 0, 9899999, 0, 19999999, 29999999, 0, 59999999, 0
Offset: 1

Views

Author

Amarnath Murthy, Aug 15 2002

Keywords

Examples

			The first composite number (A002808) is 4 and the least prime whose digital sum is 4 is 13.
The second composite number (A002808) is 6 whose digital sum is == 0 (mod 3) so there is no prime whose fits the definition.
		

Crossrefs

Equals A067180(A002808(n)). Cf. A111397.

Programs

  • Mathematica
    Composite[n_] := FixedPoint[n + PrimePi[ # ] + 1 &, n]; f[n_] := Block[{cn = Composite[n]}, k = 1; While[Plus @@ IntegerDigits@Prime@k != cn, k++ ]; Prime[k]];

Formula

a(n)=0 iff that composite number (A002808(n)) is congruent to 0 (modulo 3), otherwise a(n)=A007605(k) for the first k that equals A002808(n).

Extensions

a(19)-a(32) from Stefan Steinerberger, Nov 09 2005
a(33)-a(56) by Robert G. Wilson v, Nov 10 2005

A104250 Sum of prime digits of n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 0, 3, 7, 0, 5, 2, 3, 10, 0, 3, 7, 8, 5, 0, 7, 7, 10, 7, 3, 0, 7, 0, 3, 7, 0, 3, 9, 3, 10, 3, 0, 5, 12, 3, 7, 10, 7, 0, 0, 3, 7, 0, 2, 7, 11, 4, 8, 5, 2, 7, 14, 5, 2, 9, 16, 2, 5, 5, 10, 3, 6, 10, 6, 13, 10, 3, 11, 8, 10, 13, 10, 6, 3, 10, 0, 0, 0, 2, 3, 6, 3, 3, 0, 12, 0, 3, 7, 7, 7, 0, 0, 8, 5
Offset: 1

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Examples

			a(6)=3 because sum of prime digits of Prime[6]=13 is 3.
		

Crossrefs

Sum of nonprime digits (1, 4, 6, 8, 9) of n-th prime: A104251. Primes A000040: sum of digits of primes: A007605.

Programs

  • Mathematica
    npd[n_]:=Total[Select[IntegerDigits[n],PrimeQ]]; Table[npd[p],{p,Prime[ Range[100]]}] (* Harvey P. Dale, Apr 24 2014 *)

Formula

a(n)=A007605(n)-A104251(n)

A106807 Primes with digit sum = 67.

Original entry on oeis.org

59899999, 69899899, 69899989, 69979999, 69997999, 69999799, 77899999, 78997999, 78998989, 78999889, 78999979, 79699999, 79879999, 79889899, 79979899, 79979989, 79988899, 79989979, 79996999, 79997899, 79997989
Offset: 1

Views

Author

Zak Seidov, May 18 2005

Keywords

Comments

499999909 is the smallest term that contains 0 as a digit. - Altug Alkan, Mar 25 2018

Crossrefs

Cf. similar sequences listed in A244018.

Programs

  • Magma
    [p: p in PrimesUpTo(90000000) | &+Intseq(p) eq 67]; // Vincenzo Librandi, Jul 09 2014
    
  • Maple
    F:= proc(t,d)
      if d = 1 then
         if t<=9 then return [t] else return [] fi
      fi;
      if t > 9*d then return [] fi;
      [seq(op(map(x -> a*10^(d-1)+x, procname(t-a,d-1))), a=0..min(9,t))]
    end proc:
    select(isprime, F(67,8)); # Robert Israel, Mar 25 2018
  • Mathematica
    Select[Prime[Range[600000]], Total[IntegerDigits[#]]==67 &] (* Vincenzo Librandi, Jul 09 2014 *)
  • PARI
    isok(n) = isprime(n) && (sumdigits(n) == 67); \\ Altug Alkan, Mar 25 2018

A239691 Base 5 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 1, 3, 3, 5, 5, 7, 7, 5, 3, 5, 5, 7, 7, 5, 7, 5, 7, 7, 9, 7, 7, 9, 9, 5, 7, 7, 9, 9, 3, 3, 5, 7, 9, 3, 5, 7, 7, 9, 7, 5, 7, 9, 9, 11, 7, 11, 7, 9, 9, 11, 9, 3, 5, 7, 9, 7, 5, 5, 7, 9, 7, 7, 9, 9, 7, 9, 11, 13, 9, 11, 11, 13, 7, 7, 9, 9, 5, 9, 11, 9, 7, 9
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-5 dominance order on the natural numbers.

Examples

			The fifth prime is 11, 11 in base 5 is (2,1) so a(5)=2+1=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),5): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 5], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 5); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=5)) for i in primes_first_n(200)]
    

Formula

a(n) = A053824(A000040(n)).
Previous Showing 11-20 of 92 results. Next