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.

A104260 Sum of odd digits (1,3,5,7,9) of n-th prime.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Feb 26 2005

Keywords

Crossrefs

Sum of even digits (2, 4, 6, 8) of n-th prime: A104261, sum of prime digits (2, 3, 5, 7) of n-th prime: A104250, sum of composite (nonprime) digits (1, 4, 6, 8, 9) of n-th prime: A104251, sum of digits of primes: A007605, primes: A000040.

Programs

  • Mathematica
    sodod={};Do[id=IntegerDigits[Prime[i]];lid=Length[id];sod=Sum[If[OddQ[id[[k]]], id[[k]], 0], {k, lid}];sodod={sodod, sod}, {i, 200}];sodod//Flatten
    f[n_] := Plus @@ Select[ IntegerDigits[ Prime[n]], OddQ[ # ] &]; Table[ f[n], {n, 88}] (* Robert G. Wilson v, Nov 03 2005 *)

Formula

a(n) = A007605(n) - A104261(n).