OFFSET
1,1
EXAMPLE
The base-4 representation of 17 is 101, which is periodic when considering leading zeros, i.e., 0101, so 17 is a term of the sequence.
The base-4 representation of 170 is 2222, which is periodic, so 170 is a term of the sequence.
The base-4 representation of 1495 is 113113, which is periodic, so 1495 is a term of the sequence.
PROG
(PARI) subvec(vec, pos, len) = my(w=[]); for(k=pos, pos+len-1, if(k > #vec, return(0), w=concat(w, vec[k]))); w
is_perio(vec) = my(d=divisors(#vec), v=[], w=[]); for(x=2, #d-1, v=subvec(vec, 1, d[x]); forstep(y=1, #vec, d[x], w=subvec(vec, y, d[x]); if(w!=v, break, if(y+d[x] >= #vec, return(1))))); 0
is(n) = my(d=digits(n, 4), z=[]); if(#d < 2, return(0)); if(vecmin(d)==vecmax(d), return(1)); while(#z <= #d, if(is_perio(concat(z, d)), return(1)); z=concat(z, [0])); 0
(PARI) is(n, b=4) = for (w=1, oo, my (d=digits(n, b^w)); if (#d<=1, return (0), #Set(d)==1, return (1))) \\ Rémy Sigrist, Nov 16 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Nov 11 2018
STATUS
approved