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.

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

A041000 If decimal expansion of n-th prime is x1 x2 ... xk, sort the xi into nonincreasing order, y1 y2 ... yk; then a(n) = |y1-y2-y3...-yk|.

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, 1, 4, 1, 3, 5, 4, 3, 1, 2, 0, 3, 1, 6, 7, 5, 1, 1, 0, 1, 3, 5, 2, 4, 1, 2, 0, 1, 1, 4, 2, 5, 3, 4, 4, 1, 1, 3, 1, 1, 0, 2, 1, 1, 2, 1, 1, 2, 2, 1, 3, 5, 4, 1, 0, 2, 2, 3, 1, 2, 1, 1, 3, 2, 3, 4, 4, 2, 4, 2, 0, 0, 2, 3, 2, 2, 1, 5
Offset: 1

Views

Author

Keywords

Examples

			a(397)=|9-7-3|=1.
		

Crossrefs

Programs

  • Mathematica
    der[n_]:=Module[{c=Reverse[Sort[IntegerDigits[n]]]},Abs[First[c]-Total[Rest[c]]]]; der/@Prime[Range[110]] (* Harvey P. Dale, Aug 15 2012 *)

Formula

a(n) = |A007953(n)-2*A054055(n)|. [Charles R Greathouse IV, May 07 2011]

Extensions

More terms from Michel ten Voorde

A115261 Prime numbers such that the absolute difference of the sum of their digits in odd positions and the sum of their digits in even positions is also a prime.

Original entry on oeis.org

2, 3, 5, 7, 13, 29, 31, 41, 47, 53, 61, 79, 83, 97, 101, 113, 137, 139, 151, 157, 163, 167, 173, 179, 191, 193, 211, 223, 227, 233, 251, 269, 277, 281, 283, 311, 313, 337, 359, 379, 383, 401, 409, 421, 431, 443, 467, 487, 541, 557, 563, 577, 599, 601, 607, 641
Offset: 1

Views

Author

Keywords

Examples

			1237 is in the sequence because it is prime and abs((7+2)-(3+1)) = 5 is prime
		

Crossrefs

Programs

  • Maple
    Df:=proc(N) j:=1; for n from 1 while j<=N do B:= convert(ithprime(n),base,10); ap:=-(sum(B[2*i],i=1..nops(B)/2)-sum(B[2*n+1],i=0..(nops(B)-1)/2)); if (isprime(abs(ap)) = true) then a[j]:=ithprime(n); j:=j+1; fi; od; end:

A115259 Difference between the sum of digits in odd positions and the sum of digits in even positions of prime numbers.

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, 2, 4, 8, 10, 3, 6, -1, 5, 7, 6, -3, 3, -2, 2, -3, 3, -6, -7, -5, -1, 1, 2, 3, 7, 9, 2, 8, -1, -2, 4, -1, 5, -4, 2, -5, -3, -4, 10, 3, 5, 9, 1, 7, 6, 8, 1, 7, 4, -1, 5, -2, 4, 1, 5, 13, 12, 3, 2, 4, 10, 3, 9, 6, -1, 1, 5, 6, 3, -4, 4, 8, 14, 4, 6, 2, 8, 7, 2, 8, -1, 5, 4, -1, 5, 7
Offset: 1

Views

Author

Keywords

Comments

Zero corresponds to the prime 11. It is easy to show that there is no other zero: if the difference of odd-even digits of a number is zero, the number is a multiple of 11, i.e., it is not a prime.
Positions are counted from the least to the most significant digit, so for prime 17 the odd digit is 7 and the even digit is 1. - Harvey P. Dale, Dec 15 2022

Examples

			a(37) = 3 because 37th prime = 157, (7+1) - 5 = 3.
		

Crossrefs

Programs

  • Maple
    A115259 := proc(n) A055017(ithprime(n)) ; end proc: # R. J. Mathar, Aug 26 2011
  • Mathematica
    Table[Total[Take[Reverse[IntegerDigits[p]],{1,-1,2}]]-Total[Take[Reverse[IntegerDigits[p]],{2,-1,2}]],{p,Prime[Range[120]]}] (* Harvey P. Dale, Dec 15 2022 *)

Formula

a(n) = A055017(A000040(n)). - R. J. Mathar, Aug 26 2011

A115260 Prime numbers in the sequence of the absolute difference of the sum of digits in odd positions and the sum of digits in even positions of prime numbers.

Original entry on oeis.org

2, 3, 5, 7, 2, 7, 2, 3, 3, 2, 5, 2, 5, 2, 2, 3, 5, 7, 3, 3, 2, 2, 3, 3, 7, 5, 2, 3, 7, 2, 2, 5, 2, 5, 3, 3, 5, 7, 7, 5, 2, 5, 13, 3, 2, 3, 5, 3, 2, 7, 2, 5, 5, 7, 13, 3, 5, 2, 2, 7, 13, 3, 2, 3, 5, 17, 7, 13, 5, 3, 7, 17, 13, 7, 3, 7, 7, 2, 3, 5, 5, 2, 2, 7, 3, 3, 7, 2, 3, 7, 2, 3, 7, 2, 5, 5, 3, 2, 7, 3, 5, 7
Offset: 1

Views

Author

Keywords

Comments

Primes in the sequence A115259.

Examples

			a(37) = 3 because 37th prime = 157, (7+1) - 5 = 3, 3 is prime.
		

Crossrefs

Programs

  • Maple
    select(isprime,[seq(abs(sum(convert(ithprime(a),base,10)[2*i],i=1..nops(convert (ithprime(a),base,10))/2)-sum(convert(ithprime(a),base,10)[2*i+1],i=0..(nops (convert(ithprime(a),base,10))-1)/2)),a=1..N)]);

A084686 Take n-th prime p(n), rewrite it with digits in decreasing order to get b(n), then a(n)=(b(n)-p(n))/9.

Original entry on oeis.org

0, 0, 0, 0, 0, 2, 6, 8, 1, 7, 0, 4, 0, 0, 3, 0, 4, 0, 1, 0, 0, 2, 0, 1, 0, 1, 23, 67, 89, 22, 66, 20, 66, 88, 88, 40, 66, 52, 66, 62, 88, 70, 80, 82, 86, 88, 0, 11, 55, 77, 11, 77, 20, 30, 55, 41, 77, 50, 55, 60, 61, 71, 47, 0, 2, 46, 0, 44, 44, 66, 20, 66, 44, 40, 66, 50, 66, 64, 1, 59, 58
Offset: 1

Views

Author

Zak Seidov, Jun 30 2003

Keywords

Examples

			a(7)=6 because p(7)=17, b(n)=71 and (71-17)/9=6.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,L,i;
      p:= ithprime(n);
      L:= sort(convert(p,base,10));
      (add(10^(i-1)*L[i],i=1..nops(L))-p)/9
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 26 2019
  • Mathematica
    Table[ -Prime[n]-FromDigits[Sort[ -IntegerDigits[Prime[n]]]], {n, 1, 100}]

Formula

a(n) = A283001(A000040(n)). - Robert Israel, Nov 26 2019
Showing 1-6 of 6 results.