A146087 a(n) = 3*A146085(n) - 1.
2, 11, 20, 83, 92, 101, 164, 173, 182, 731, 740, 749, 812, 821, 830, 893, 902, 911, 1460, 1469, 1478, 1541, 1550, 1559, 1622, 1631, 1640, 6563, 6572, 6581, 6644, 6653, 6662, 6725, 6734, 6743, 7292, 7301, 7310, 7373, 7382, 7391, 7454, 7463, 7472, 8021, 8030, 8039, 8102, 8111, 8120
Offset: 1
Keywords
Programs
-
Mathematica
fQ[n_] := Module[{d = Reverse[IntegerDigits[n, 3]], k = 3, ans = True}, While[k <= Length[d], If[d[[k]] > 0, ans = False]; k += 2]; ans && d[[1]] == 1]; aQ[n_] := Mod[n + 1, 3] == 0 && fQ[(n + 1)/3]; Select[Range[10000], aQ] (* Amiram Eldar, Dec 09 2018 *)
-
PARI
isa(n) = {my(d=Vecrev(digits(n, 3)), k=3); while (k <= #d, if (d[k], return (0)); k += 2;); d[1] == 1;} \\ A146085 isok(n) = !((n+1) % 3) && isa((n+1)/3); \\ Michel Marcus, Dec 09 2018
Extensions
More terms from Michel Marcus, Dec 09 2018
Comments