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.
%I A317240 #25 Jul 14 2021 14:54:07 %S A317240 1,0,1,1,0,1,1,1,1,1,0,1,2,1,1,1,1,1,2,1,2,2,0,1,2,0,2,1,2,1,3,1,1,1, %T A317240 1,1,2,1,2,3,2,1,4,1,3,2,0,1,2,1,3,2,1,1,3,0,2,3,2,1,3,1,3,3,1,2,4,1, %U A317240 2,1,3,1,2,1,2,3,2,1,3,1,4,2,2,1,3,1,4,3,2,1,5,3,3,4,0,2,2,1,3,2,2,1,5,1,3 %N A317240 Number of representations of n of the form 1 + p1 * (1 + p2* ... * (1 + p_j)...), where [p1, ..., p_j] is a (possibly empty) list of (not necessarily distinct) primes. %H A317240 Alois P. Heinz, <a href="/A317240/b317240.txt">Table of n, a(n) for n = 1..65536</a> %F A317240 a(n) = Sum_{prime p|(n-1)} a((n-1)/p) for n>1, a(1) = 1. %F A317240 a(n) = 0 <=> n in { A180337 }. %F A317240 a(n) >= A317241(n). %F A317240 G.f. A(x) satisfies: A(x) = x * (1 + A(x^2) + A(x^3) + A(x^5) + ... + A(x^prime(k)) + ...). - _Ilya Gutkovskiy_, May 09 2019 %e A317240 a(13) = 2: 1 + 2 * (1 + 5) = 1 + 3 * (1 + 3) = 13. %e A317240 a(31) = 3: 1 + 2 * (1 + 2 * (1 + 2 * (1 + 2))) = 1 + 3 * (1 + 3 * (1 + 2)) = 1 + 5 * (1 + 5) = 31. %p A317240 a:= proc(n) option remember; `if`(n=1, 1, %p A317240 add(a((n-1)/p), p=numtheory[factorset](n-1))) %p A317240 end: %p A317240 seq(a(n), n=1..200); %t A317240 pp[n_] := pp[n] = FactorInteger[n][[All, 1]]; %t A317240 q[n_] := q[n] = Switch[n, 1, True, 2, False, _, AnyTrue[pp[n-1], q[(n-1)/#]&]]; %t A317240 a[n_] := a[n] = Which[n == 1, 1, !q[n], 0, True, Sum[a[(n-1)/p], {p, pp[n-1]}]]; %t A317240 Array[a, 105] (* _Jean-François Alcover_, Jul 14 2021, after _Alois P. Heinz_ *) %Y A317240 Cf. A180337, A317241, A317384. %K A317240 nonn %O A317240 1,13 %A A317240 _Alois P. Heinz_, Jul 24 2018