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.

A328614 Number of 1-digits in primorial base expansion of n.

This page as a plain text file.
%I A328614 #14 Mar 13 2024 01:50:24
%S A328614 0,1,1,2,0,1,1,2,2,3,1,2,0,1,1,2,0,1,0,1,1,2,0,1,0,1,1,2,0,1,1,2,2,3,
%T A328614 1,2,2,3,3,4,2,3,1,2,2,3,1,2,1,2,2,3,1,2,1,2,2,3,1,2,0,1,1,2,0,1,1,2,
%U A328614 2,3,1,2,0,1,1,2,0,1,0,1,1,2,0,1,0,1,1,2,0,1,0,1,1,2,0,1,1,2,2,3,1,2,0,1,1,2
%N A328614 Number of 1-digits in primorial base expansion of n.
%H A328614 Antti Karttunen, <a href="/A328614/b328614.txt">Table of n, a(n) for n = 0..32768</a>
%H A328614 <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>.
%F A328614 a(n) = A056169(A276086(n)).
%F A328614 a(n) = A267263(n) - A328615(n).
%F A328614 For n >= 1, a(A143293(n-1)) = n. [This is the first occurrence of each n]
%e A328614 In primorial base (A049345), 87 is written as "2411" because 87 = 2*A002110(3) + 4*A002110(2) + 1*A002110(1) + 1*A002110(0) = 2*30 + 4*6 + 1*2 + 1*1. Only two of these digits are "1"'s, thus a(87) = 2.
%t A328614 a[n_] := Module[{k = n, p = 2, s = 0, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, If[r == 1, s++]; p = NextPrime[p]]; s]; Array[a, 100, 0] (* _Amiram Eldar_, Mar 13 2024 *)
%o A328614 (PARI) A328614(n) = { my(s=0, p=2); while(n, s += (1==(n%p)); n = n\p; p = nextprime(1+p)); (s); };
%Y A328614 Cf. A049345, A056169, A267263, A276086, A328615, A328616.
%Y A328614 Cf. A143293 (positions of records after initial zero).
%Y A328614 Cf. also A257511.
%K A328614 nonn,base
%O A328614 0,4
%A A328614 _Antti Karttunen_, Oct 22 2019