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

A287093 a(0) = 0, a(1) = 2; a(2*n) = sopf(a(n)), a(2*n+1) = a(n) + a(n+1), where sopf() is the sum of the distinct prime factors (A008472).

Original entry on oeis.org

0, 2, 2, 4, 2, 6, 2, 6, 2, 8, 5, 8, 2, 8, 5, 8, 2, 10, 2, 13, 5, 13, 2, 10, 2, 10, 2, 13, 5, 13, 2, 10, 2, 12, 7, 12, 2, 15, 13, 18, 5, 18, 13, 15, 2, 12, 7, 12, 2, 12, 7, 12, 2, 15, 13, 18, 5, 18, 13, 15, 2, 12, 7, 12, 2, 14, 5, 19, 7, 19, 5, 14, 2, 17, 8, 28, 13, 31, 5, 23, 5, 23, 5, 31, 13, 28, 8, 17, 2, 14, 5
Offset: 0

Views

Author

Ilya Gutkovskiy, May 19 2017

Keywords

Comments

A variation on Stern's diatomic sequence.

Examples

			a(0) = 0;
a(1) = 2;
a(2) = a(2*1) = sopf(a(1)) = 2;
a(3) = a(2*1+1) = a(1) + a(2) = 4;
a(4) = a(2*2) = sopf(a(2)) = 2;
a(5) = a(2*2+1) = a(2) + a(3) = 6;
a(6) = a(2*3) = sopf(a(3)) = 2, etc.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 2; a[n_] := If[EvenQ[n], DivisorSum[a[n/2], # &, PrimeQ[#] &], a[(n - 1)/2] + a[(n + 1)/2]]; Table[a[n], {n, 0, 90}]
  • PARI
    a(n) = if (n==0, 0, if (n ==1, 2, if (n%2, a((n-1)/2) + a((n+1)/2), vecsum(factor(a(n/2))[,1])))); \\ Michel Marcus, Dec 17 2017
Showing 1-1 of 1 results.