OFFSET
4,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 4..1000
FORMULA
a(4) = 1; a(n) = 1 + Sum a(k), k semiprime, k | n-1.
EXAMPLE
a (5) = 2 = 1 + a(4) because 4 | (5-1) and 4 = 2*2 is a semiprime.
a (6) = 1 because there is no semiprime that divides (6-1) = 5, a prime.
a (7) = 2 = 1 + a(6) = 1+1 because 6 | (7-1) and 6 = 2*3 is a semiprime.
a (8) = 1 because there is no semiprime that divides (8-1) = 7, a prime.
a (9) = 2 = 1 + a(4) = 1+1 because 4 | (9-1).
a(10) = 3 = 1 + a(9) = 1+2 because 9 | (10-1) and 9 is a semiprime.
a(11) = 4 = 1 + a(10) = 1+3 because 10 | (11-1) and 10 = 2*5 is a semiprime.
a(12) = 1 because there is no semiprime that divides (12-1) = 11, a prime.
a(13) = 3 = 1 + a(4) + a(6) = 1+1+1 because both 4 and 6 divide into (13-1) = 12 and are semiprimes.
a(14) = 1 because there is no semiprime that divides (14-1) = 13, a prime.
a(15) = 2 = 1 + a(14) = 1+1 because 14 | (15-1).
a(16) = 3 = 1 + a(15) = 1+2 because 15=3*5 is the only semiprime which divides 16-1.
a(17) = 2 = 1 + a(4) = 1+1 because 4 | (17-1) and 4 is the only such semiprime.
MAPLE
a:= proc(n) option remember; 1 +add (`if` (not isprime(k) and add (i[2], i=ifactors(k)[2])=2 and irem (n-1, k)=0, a(k), 0), k=4..n-1) end: seq (a(n), n=4..100); # Alois P. Heinz, Dec 12 2010
MATHEMATICA
a[n_] := a[n] = 1 + Sum[If[!PrimeQ[k] && Total@FactorInteger[k][[All, 2]] == 2 && Mod[n - 1, k] == 0, a[k], 0], {k, 4, n - 1}];
a /@ Range[4, 100] (* Jean-François Alcover, Nov 20 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Dec 12 2010
EXTENSIONS
More terms from Alois P. Heinz, Dec 12 2010
STATUS
approved