OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
4184046 is a term since 4184046, 4184047 and 4184048 are all primitive binary Niven numbers.
MATHEMATICA
binNivQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; primBinNivQ[n_] := binNivQ[n] && ! (EvenQ[n] && binNivQ[n/2]);
seq[kmax_] := Module[{tri = primBinNivQ /@ Range[3], s = {}, k = 4}, While[k < kmax, If[And @@ tri, AppendTo[s, k - 3]]; tri = Join[Rest[tri], {primBinNivQ[k]}]; k++]; s]; seq[10^7]
PROG
(PARI) isbinniv(n) = !(n % hammingweight(n));
isprim(n) = isbinniv(n) && !(!(n%2) && isbinniv(n/2));
lista(kmax) = {my(tri = vector(3, i, isprim(i)), k = 4); while(k < kmax, if(vecsum(tri) == 3, print1(k-3, ", ")); tri = concat(vecextract(tri, "^1"), isprim(k)); k++); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Jun 22 2023
STATUS
approved