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

A111309 Absolute difference between the sum of the odd digits and the sum of the even digits of the n-th prime.

Original entry on oeis.org

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

Views

Author

Zak Seidov and Robert G. Wilson v, Mar 02 2005

Keywords

Examples

			a(9)=1 because the 9th prime is 23 and the absolute difference between 2 & 3 is 1.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local Lo,Le;
      Lo,Le:= selectremove(type,convert(n,base,10),odd);
      abs(convert(Lo,`+`)-convert(Le,`+`))
    end proc:
    map(f, [seq(ithprime(i),i=1..100)]); # Robert Israel, Nov 12 2024
  • Mathematica
    f[n_] := (id = IntegerDigits[ Prime[n]]; Abs[(Plus @@ id) - 2Plus @@ Select[id, OddQ]]); Table[f[n], {n, 91}]

Extensions

Edited by Charles R Greathouse IV, Aug 04 2010

A088290 Prime numbers in which the sum of the external digits = the sum of the internal digits.

Original entry on oeis.org

1021, 1087, 1201, 1223, 1289, 1447, 1559, 1627, 2053, 2143, 2389, 2503, 2659, 2749, 3041, 3221, 3467, 3557, 3917, 4051, 4073, 4231, 4253, 4297, 4523, 4567, 4657, 4679, 4703, 5443, 5623, 5689, 5779, 5869, 6521, 6701, 6857, 6947, 7193, 7283, 7351, 7621
Offset: 1

Views

Author

Amarnath Murthy, Sep 29 2003

Keywords

Examples

			1021 is a member 1+1 = 0+2 = 2..
		

Crossrefs

Primes in A101317.
Cf. A076167.

Programs

  • Maple
    filter:= proc(n) local L,i;
      if not isprime(n) then return false fi;
      L:= convert(n,base,10);
      L[1] + L[-1] = add(L[i],i=2..nops(L)-1)
    end proc:
    select(filter, [seq(i,i=101..10^4,2)]); # Robert Israel, Oct 30 2024
  • Mathematica
    edidQ[n_]:=Module[{idn=IntegerDigits[n]},idn[[1]]+idn[[-1]]==Total[Most[ Rest[idn]]]]; Select[Prime[Range[169,3000]],edidQ] (* Harvey P. Dale, Apr 20 2012 *)

Extensions

More terms from David Wasserman, Aug 04 2005
Offset changed by Andrew Howroyd, Sep 19 2024
Showing 1-2 of 2 results.