|
| |
|
|
A055778
|
|
Number of 1's in base phi representation of n.
|
|
14
| |
|
|
0, 1, 2, 2, 3, 3, 3, 2, 3, 4, 4, 5, 4, 4, 4, 5, 4, 4, 2, 3, 4, 4, 5, 5, 5, 4, 5, 6, 6, 7, 5, 5, 5, 6, 5, 5, 4, 5, 6, 6, 7, 5, 5, 5, 6, 5, 5, 2, 3, 4, 4, 5, 5, 5, 4, 5, 6, 6, 7, 6, 6, 6, 7, 6, 6, 4, 5, 6, 6, 7, 7, 7, 6, 7, 8, 8, 9, 6, 6, 6, 7, 6, 6, 5, 6, 7, 7, 8, 6, 6, 6, 7, 6, 6, 4, 5, 6, 6, 7, 7, 7, 6, 7, 8, 8
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 0,3
|
|
|
COMMENTS
| Uses greedy algorithm (start with largest possible power of phi, then work downward)
constant (float): phi=(sqrt(5)+1)/2; function: lphi(x)=log(x)/log(phi); variable (float): rem=n; variable (integer): count=0; loop: while rem>0 {rem=rem-phi^floor[lphi(x)]; count++;} result: return count;
|
|
|
LINKS
| Carmine Suriano, Table of n, a(n) for n = 0..5000
R. Knott, Using Powers of Phi to represent Integers (Base Phi) (inspiration for this sequence).
Eric Weisstein's World of Mathematics, Phi Number System
|
|
|
EXAMPLE
| The phi-expansions for n<=15 are:
n phi-rep(n) a(n)
0 0. 0
1 1. 1
2 10.01 2
3 100.01 2
4 101.01 3
5 1000.1001 3
6 1010.0001 3
7 10000.0001 2
8 10001.0001 3
9 10010.0101 4
10 10100.0101 4
11 10101.0101 5
12 100000.101001 4
13 100010.001001 4
14 100100.001001 4
15 100101.001001 5
[Joerg Arndt, Jan 30 2012]
|
|
|
MATHEMATICA
| nn = 100; len = 2*Ceiling[Log[GoldenRatio, nn]]; Table[d = RealDigits[n, GoldenRatio, len]; Total[d[[1]]], {n, 0, nn}] (* T. D. Noe, May 20 2011 *)
|
|
|
CROSSREFS
| Sequence in context: A194883 A175453 A014499 * A106482 A122462 A115230
Adjacent sequences: A055775 A055776 A055777 * A055779 A055780 A055781
|
|
|
KEYWORD
| base,easy,nonn
|
|
|
AUTHOR
| Robert Lozyniak (11(AT)onna.com), Jul 12 2000
|
|
|
EXTENSIONS
| More terms and algorithm from Henry Bottomley (se16(AT)btinternet.com), Aug 04 2000
|
| |
|
|