cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A079399 Number of dots in Braille representation of n.

Original entry on oeis.org

3, 1, 2, 2, 3, 2, 3, 4, 3, 2, 4, 2, 3, 3, 4, 3, 4, 5, 4, 3, 5, 3, 4, 4, 5, 4, 5, 6, 5, 4, 5, 3, 4, 4, 5, 4, 5, 6, 5, 4, 6, 4, 5, 5, 6, 5, 6, 7, 6, 5, 5, 3, 4, 4, 5, 4, 5, 6, 5, 4, 6, 4, 5, 5, 6, 5, 6, 7, 6, 5, 7, 5, 6, 6, 7, 6, 7, 8, 7, 6, 6, 4, 5, 5, 6, 5, 6, 7, 6, 5, 5, 3, 4, 4, 5, 4, 5, 6, 5, 4
Offset: 0

Views

Author

Jon Perry, Feb 16 2003

Keywords

Comments

The number of dots in [0..9] is [3,1,2,2,3,2,3,4,3,2].

Examples

			a(11) = 1+1 = 2.
		

Crossrefs

See A072283 for another version. Cf. A079401, A079405.

Programs

  • Mathematica
    With[{br=Thread[Range[0,9]->{3,1,2,2,3,2,3,4,3,2}]},Total/@ Table[ IntegerDigits[ n]/.br,{n,0,100}]] (* Harvey P. Dale, May 24 2013 *)
  • PARI
    { braille=[3,1,2,2,3,2,3,4,3,2]; for (n=0,99, b=braille[n%10+1]; if (n>9,b=b+braille[n\10+1]); print1(b",")) }
    
  • Python
    b = [3, 1, 2, 2, 3, 2, 3, 4, 3, 2]
    def a(n): return sum(b[d] for d in map(int, str(n)))
    print([a(n) for n in range(100)]) # Michael S. Branicky, Mar 01 2021

Formula

a(n) = A000120(A121018(n)) = A000120(A121019(n)). - Reinhard Zumkeller, Jul 23 2006

A121018 Value of n written in Braille, seen as 3 X 2 bit-code: 1 for a raised dot and 0 for an empty dot position.

Original entry on oeis.org

28, 32, 40, 48, 52, 36, 56, 60, 44, 24, 2076, 2080, 2088, 2096, 2100, 2084, 2104, 2108, 2092, 2072, 2588, 2592, 2600, 2608, 2612, 2596, 2616, 2620, 2604, 2584, 3100, 3104, 3112, 3120, 3124, 3108, 3128, 3132, 3116, 3096, 3356, 3360, 3368, 3376, 3380, 3364
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 23 2006

Keywords

Comments

A000120(a(n)) = A079399(n).

Examples

			...... +-----+
n=0: . | _ . | -> (01)(11)(00)
...... | . . | .. -> 011100[bin] = 28 = a(0)
...... | _ _ |
...... +-----+
n=1: . | . _ | -> (10)(00)(00)
...... | _ _ | .. -> 100000[bin] = 32 = a(1)
...... | _ _ |
...... +-----+
n=2: . | . _ | -> (10)(10)(00)
...... | . _ | .. -> 101000[bin] = 40 = a(2)
...... | _ _ |
...... +-----+
n=3: . | . . | -> (11)(00)(00)
...... | _ _ | .. -> 110000[bin] = 48 = a(3)
...... | _ _ |
...... +-----+
n=4: . | . . | -> (11)(01)(00)
...... | _ . | .. -> 110100[bin] = 52 = a(4)
...... | _ _ |
...... +-----+
n=5: . | . _ | -> (10)(01)(00)
...... | _ . |.. -> 100100[bin] = 36 = a(5)
...... | _ _ |
...... +-----+
n=6: . | . . | -> (11)(10)(00)
...... | . _ | .. -> 111000[bin] = 56 = a(6)
...... | _ _ |
...... +-----+
n=7: . | . . | -> (11)(11)(00)
...... | . . | .. -> 111100[bin] = 60 = a(7)
...... | _ _ |
...... +-----+
n=8: . | . _ | -> (10)(11)(00)
...... | . . | .. -> 101100[bin] = 44 = a(8)
...... | _ _ |
...... +-----+
n=9: . | _ . | -> (01)(10)(00)
...... | . _ | .. -> 011000[bin] = 24 = a(9)
...... | _ _ |
...... +-----+.
		

Crossrefs

Cf. A121019.

Programs

  • Mathematica
    a[0]=28;a[1]= 32;a[2]= 40;a[3]= 48;a[4]= 52;a[5]= 36;a[6]= 56;a[7]= 60;a[8]= 44;a[9]= 24;a[n_]:=a[Floor[n/10]]*64+a[Mod[n,10]];Table[a[n],{n,0,45}] (* James C. McMahon, Oct 11 2024 *)

Formula

a(n) = a(floor(n/10))*64 + a(n mod 10) for n>9.
Showing 1-2 of 2 results.