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.

A076310 a(n) = floor(n/10) + 4*(n mod 10).

Original entry on oeis.org

0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 7, 11, 15, 19, 23
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 06 2002

Keywords

Comments

(n==0 modulo 13) iff (a(n)==0 modulo 13); applied recursively, this property provides a divisibility test for numbers given in base 10 notation.

Examples

			435598 is not a multiple of 13, as 435598 -> 43559+4*8=43591 -> 4359+4*1=4363 -> 436+4*3=448 -> 44+4*8=76 -> 7+4*6=29=13*2+3, therefore the answer is NO.
Is 8424 divisible by 13? 8424 -> 842+4*4=858 -> 85+4*8=117 -> 11+4*7=39=13*3, therefore the answer is YES.
		

References

  • Karl Menninger, Rechenkniffe, Vandenhoeck & Ruprecht in Goettingen (1961), 79A.

Crossrefs

Programs

  • Haskell
    a076310 n =  n' + 4 * m where (n', m) = divMod n 10
    -- Reinhard Zumkeller, Jun 01 2013
    
  • Magma
    [Floor(n/10)+4*(n mod 10): n in [0..75]]; // Vincenzo Librandi, Feb 27 2016
  • Maple
    A076310:=n->floor(n/10) + 4*(n mod 10); seq(A076310(n), n=0..100); # Wesley Ivan Hurt, Jan 30 2014
  • Mathematica
    Table[Floor[n/10] + 4*Mod[n, 10], {n, 0, 100}] (* Wesley Ivan Hurt, Jan 30 2014 *)
    LinearRecurrence[{1,0,0,0,0,0,0,0,0,1,-1},{0,4,8,12,16,20,24,28,32,36,1},80] (* Harvey P. Dale, Sep 30 2015 *)
  • PARI
    a(n) = n\10 + 4*(n % 10); \\ Michel Marcus, Jan 31 2014
    

Formula

a(n) = +a(n-1) +a(n-10) -a(n-11). G.f.: -x*(-4-4*x-4*x^2-4*x^3-4*x^4-4*x^5-4*x^6-4*x^7-4*x^8+35*x^9) / ( (1+x) *(x^4+x^3+x^2+x+1) *(x^4-x^3+x^2-x+1) *(x-1)^2 ). - R. J. Mathar, Feb 20 2011