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.

A285717 a(n) = A007814(n) + A159918(n) = A007814(n) + A000120(n^2).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 27 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[IntegerExponent[n, 2] + DigitCount[n^2, 2, 1], {n, 120}] (* Indranil Ghosh, Apr 27 2017 *)
  • PARI
    a(n) = valuation(n, 2) + hammingweight(n^2); \\ Indranil Ghosh, Apr 27 2017
    
  • Python
    import math
    def a(n): return int(math.log(n - (n & n - 1), 2)) + bin(n**2)[2:].count("1") # Indranil Ghosh, Apr 27 2017
  • Scheme
    (define (A285717 n) (+ (A007814 n) (A159918 n)))
    (define (A285717 n) (A007814 (* n (A201555 n))))
    

Formula

a(n) = A007814(n) + A159918(n) = A007814(n) + A000120(n^2).
a(n) = A007814(n*A201555(n)).