A328770 Numbers in whose primorial base expansion any digit is at most half of the maximal allowed digit for that position.
0, 2, 6, 8, 12, 14, 30, 32, 36, 38, 42, 44, 60, 62, 66, 68, 72, 74, 90, 92, 96, 98, 102, 104, 210, 212, 216, 218, 222, 224, 240, 242, 246, 248, 252, 254, 270, 272, 276, 278, 282, 284, 300, 302, 306, 308, 312, 314, 420, 422, 426, 428, 432, 434, 450, 452, 456, 458, 462, 464, 480, 482, 486, 488, 492, 494, 510, 512, 516, 518, 522
Offset: 1
Examples
2 is included, as in the primorial base (A049345) it is written as "10", thus 2 is included in the sequence as the maximal value that can occur in the second rightmost digit (in the primorial base representation) is 2 (as in "20" = 4 or "21" = 5 for example).
Links
Crossrefs
Programs
-
Mathematica
q[n_] := Module[{k = n, p = 2, s = {}, r}, While[{k, r} = QuotientRemainder[k, p]; k != 0 || r != 0, AppendTo[s, r]; p = NextPrime[p]]; AllTrue[s/(Prime[Range[1, Length[s]]] - 1), # <= 1/2 &]]; Select[Range[0, 600], q] (* Amiram Eldar, Mar 13 2024 *)
-
PARI
isA328770(n) = { my(p=2); while(n, if((n%p)>((p-1)/2), return(0)); n = n\p; p = nextprime(1+p)); (1); };
Comments