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.

A256496 a(n) = 15(n mod 2) + 10(n mod 3) + 6(n mod 5).

Original entry on oeis.org

31, 32, 33, 34, 35, 6, 37, 38, 39, 10, 41, 12, 43, 44, 15, 16, 47, 18, 49, 20, 21, 22, 53, 24, 25, 26, 27, 28, 59, 0, 31, 32, 33, 34, 35, 6, 37, 38, 39, 10, 41, 12, 43, 44, 15, 16, 47, 18, 49, 20, 21, 22, 53, 24, 25, 26, 27, 28, 59, 0, 31, 32, 33, 34, 35, 6
Offset: 1

Views

Author

Aaron Kastel, Mar 31 2015

Keywords

Comments

After 0 it cycles again from 31.
This is the simplest example of a(n) = b*c*(n mod a) + a*c*(n mod b) + a*b*(n mod c) with a=2, b=3, c=5.
a(n) mod abc = n mod abc.
Other values for a,b,c require modification so that bc + ac + ab = abc + 1. For example, for a=3, b=5, c=7, a(n)= 2b*c*(n mod a) + a*c*(n mod b) + a*b*(n mod c) so that 2*5*7 + 3*7 + 3*5 = 3*5*7 = 70 + 21 + 15 = 106.
This expression (with a=3, b=5, c=7) (A255818) is found in the Kol Bo (Hebrew: כלבו), a book of religious Jewish law from the 13th to 14th centuries. It is given there as a method for calculating a person's age without anyone saying it explicitly.
a(n) = n for n = 6, 10, 12, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 37, 38, 39, 41, 43, 44, 47, 49, 53, 59.

Crossrefs

Cf. A255818 for an example with 1 modification, A256643 for 2 modifications and A256668 for 3 modifications.

Programs

  • Mathematica
    Table[15 Mod[n, 2] + 10 Mod[n, 3] + 6 Mod[n, 5], {n, 60}] (* Michael De Vlieger, Mar 31 2015 *)
    LinearRecurrence[{-2,-2,-1,0,1,2,2,1},{31,32,33,34,35,6,37,38},70] (* or *) PadRight[ {},70,{31,32,33,34,35,6,37,38,39,10,41,12,43,44,15,16,47,18,49,20,21,22,53,24,25,26,27,28,59,0}] (* Harvey P. Dale, Oct 31 2016 *)
  • PARI
    vector(30, n, 15*(n%2) + 10*(n%3) + 6*(n%5)) \\ Michel Marcus, Mar 31 2015

Formula

a(n) = 15(n mod 2) + 10(n mod 3) + 6(n mod 5).
G.f.: -x*(59*x^6+146*x^5+201*x^4+195*x^3+159*x^2+94*x+31) / ((x-1)*(x+1)*(x^2+x+1)*(x^4+x^3+x^2+x+1)). - Colin Barker, Apr 07 2015
a(n) = -2*a(n-1) - 2*a(n-2) - a(n-3) + a(n-5) + 2*a(n-6) + 2*a(n-7) + a(n-8), for n>=9. - Vaclav Kotesovec, Apr 07 2015