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.

A068067 Number of integers m, 0 < m <= n, such that n divides m(m+1)/2.

Original entry on oeis.org

1, 0, 2, 0, 2, 1, 2, 0, 2, 1, 2, 1, 2, 1, 4, 0, 2, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 0, 4, 1, 4, 1, 2, 1, 4, 1, 2, 3, 2, 1, 4, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 4, 1, 2, 3, 2, 1, 4, 0, 4, 3, 2, 1, 4, 3, 2, 1, 2, 1, 4, 1, 4, 3, 2, 1, 2, 1, 2, 3, 4, 1, 4, 1, 2, 3, 4, 1, 4, 1, 4, 1, 2, 1, 4, 1, 2, 3, 2, 1, 8
Offset: 1

Views

Author

Robert G. Wilson v, Feb 18 2002

Keywords

Comments

Least n with a(n) = 2^k is prime(k+1)#/2 = A002110(A000040(k+1))/2. Least n with a(n) = 2^k-1 != 1 is p(k+1)#.

Crossrefs

Programs

  • Mathematica
    a[n_] := Length[Select[Range[n], Mod[ #(#+1)/2, n]==0&]]
  • PARI
    a(n) = {my(c = 0); for(k = 1, n, c += !((k*(k+1)/2) % n)); c;} \\ Amiram Eldar, Sep 15 2024

Formula

a(n) = 0 iff n = 2^k with k >= 1.
If n is even, a(n) = 2^(omega(n)-1) - 1; if n is odd, a(n) = 2^omega(n). Here omega(n) = A001221(n) is the number of distinct prime divisors of n.
A068068(n) - a(n) = 0 if n is odd, 1 if n is even.

Extensions

Edited by David W. Wilson and Dean Hickerson, Jun 08 2002