|
|
|
|
3, 3, 5, 3, 3, 5, 17, 3, 3, 3, 17, 5, 17, 17, 17, 3, 3, 3, 5, 3, 3, 17, 257, 5, 5, 17, 257, 17, 257, 17, 257, 3, 3, 3, 5, 3, 3, 5, 257, 3, 3, 3, 257, 17, 17, 257, 257, 5, 5, 5, 5, 17, 257, 257, 257, 17, 257, 257, 257, 17, 257, 257, 257, 3, 3, 3, 5, 3, 3, 5, 257, 3, 3, 3, 17, 5, 257, 257, 257, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
a(2*n) = a(n).
|
|
LINKS
|
|
|
EXAMPLE
|
|
|
MAPLE
|
g:= n -> convert(convert(n, base, 2), `+`):
f:= proc(n) option remember; local t, S, d, L, B, forbid, i, j, r, q;
if n::even then return procname(n/2^padic:-ordp(n, 2)) fi;
L:= convert(n, base, 2);
t:= convert(L, `+`);
B:= select(t -> L[t]=1, [$1..nops(L)]);
forbid:= {seq(seq(B[i]-B[j], j=1..i-1), i=1..nops(B))};
S[0]:= [1];
for d from 1 do
S[d]:= NULL;
for j from 0 to d-1 do
if member(d-j, forbid) then next fi;
for r in S[j] do
q:= r + 2^d;
if g(q*n) = t*g(q) then
if isprime(q) then return q fi;
S[d]:= S[d], q;
fi
od
od;
S[d]:= [S[d]];
od
end proc:
map(f, [$1..100]);
|
|
PROG
|
(PARI) a(n) = my(p=3, h=hammingweight(n)); while (hammingweight(n*p) != h*hammingweight(p), p = nextprime(p+1)); p; \\ Michel Marcus, Sep 08 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|