|
|
A081610
|
|
Number of numbers <= n having at least one 2 in their ternary representation.
|
|
8
|
|
|
0, 0, 1, 1, 1, 2, 3, 4, 5, 5, 5, 6, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, 20, 20, 20, 21, 22, 23, 24, 24, 24, 25, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
num2tern := proc(n) return numboccur(convert(n, base, 3), 2): end: a:=0: for n from 0 to 80 do a:=a+`if`(num2tern(n)>0, 1, 0): printf("%d, ", a): od: # Nathaniel Johnston, May 17 2011
|
|
MATHEMATICA
|
Accumulate[Table[If[DigitCount[n, 3, 2]>0, 1, 0], {n, 0, 70}]] (* Harvey P. Dale, Aug 20 2012 *)
|
|
PROG
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|