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-10 of 12 results. Next

A093017 Luhn algorithm double-and-add sum of digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 7, 8, 9, 10, 11, 12, 13
Offset: 0

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Starting on the right, sum digits after doubling alternating digits beginning with the second. If doubled digit >9, reduce by 9 (sum of digits).
a(n) = A007953(A249873(n)); A093019(n) = 10 - a(10*n) mod 10 if less than 10, otherwise 0. - Reinhard Zumkeller, Nov 08 2014
First differences are b(n) defined for n>0 as follows. Take the prime factorization of n and let x be the number of 2's, y be the number of 5's, and z be min(x,y). If z is even, b(n) = 1 - 9*z. If z is odd and y=z, b(n) = 2 - 9*z. If z is odd and y>z, b(n) = -7 - 9*z. Now a(n) = a(n-1) + b(n). - Mathew Englander, Aug 04 2021

Examples

			a(18) = 2*1 + 8 = 10.
a(59) = (1+0) + 9 = 10 (1 and 0 are the digits in 10 = 2*5).
		

Crossrefs

Programs

  • Haskell
    a093017 n = if n == 0 then 0 else a093017 n' + a007953 (2 * t) + d
                where (n', td) = divMod n 100; (t, d) = divMod td 10
    -- Reinhard Zumkeller, Nov 08 2014
    
  • Python
    def a(n):
        s = str(n)
        r = s[::-1]
        x = sum(int(d) for d in r[::2])
        x += sum(q if (q:=2*int(d)) < 10 else q-9 for d in r[1::2])
        return x
    print([a(n) for n in range(87)]) # Michael S. Branicky, Jul 23 2024

Formula

a(0)=0; for n not divisible by 10, a(n)=1+a(n-1); for n divisible by 10 but not 50, a(n)=2+a(n-10); for n divisible by 50 but not 100, a(n)=1+a(n-50); for n divisible by 100, a(n)=a(n/100). - Mathew Englander, Aug 04 2021

A093019 a(n) = A093018(n) mod 10.

Original entry on oeis.org

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

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Luhn mod 10 check digits of terms in A093018.

Examples

			a(1)=8 because A093018(1) mod 10 = 18 mod 10 = 8.
a(5)=9 because A093018(5) mod 10 = 59 mod 10 = 9.
		

Crossrefs

Programs

Formula

a(n) = A093018(n) - 10*n. - Reinhard Zumkeller, Nov 08 2014

A093018 Natural numbers with appended Luhn mod 10 check digit.

Original entry on oeis.org

0, 18, 26, 34, 42, 59, 67, 75, 83, 91, 109, 117, 125, 133, 141, 158, 166, 174, 182, 190, 208, 216, 224, 232, 240, 257, 265, 273, 281, 299, 307, 315, 323, 331, 349, 356, 364, 372, 380, 398, 406, 414, 422, 430, 448, 455, 463, 471, 489, 497, 505, 513, 521, 539
Offset: 0

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Indices of terms in A093017 == 0 mod 10.
A249832(a(n)) = 1; A093017(a(n)) mod 10 = 0; a(n) = 10*n + A093019(n); A093019(n) = a(n) mod 10. - Reinhard Zumkeller, Nov 08 2014
The sequence includes all Canadian Social Insurance Numbers, as well as all modern credit and debit card numbers. - Mathew Englander, Aug 04 2021

Examples

			18 is in the sequence because A093017(18)=10 == 0 mod 10.
59 is in the sequence because A093017(59)=10 == 0 mod 10.
		

Crossrefs

Programs

  • Haskell
    a093018 n = a093018_list !! n
    a093018_list = filter ((== 1) . a249832) [0..]
    -- Reinhard Zumkeller, Nov 08 2014
    
  • Python
    def a(n):
        s = str(n)
        r = s[::-1]
        x = sum(int(d) for d in r[1::2])
        x += sum(q if (q:=2*int(d)) < 10 else q-9 for d in r[::2])
        x = x%10
        c = str((10 - x) if x > 0 else 0)
        return int(s+c)
    print([a(n) for n in range(54)]) # Michael S. Branicky, Jul 23 2024

Extensions

Original name end comment interchanged by Reinhard Zumkeller, Nov 08 2014

A093025 Indices of terms in A093019 with value 5.

Original entry on oeis.org

7, 12, 26, 31, 45, 50, 69, 74, 88, 93, 106, 111, 125, 130, 149, 154, 168, 173, 187, 192, 205, 210, 229, 234, 248, 253, 267, 272, 286, 291, 309, 314, 328, 333, 347, 352, 366, 371, 385, 390, 408, 413, 427, 432, 446, 451, 465, 470, 489, 494, 502, 516, 521, 535
Offset: 1

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Integers which require a following 5 to have a valid Luhn mod 10 check digit.

Examples

			12 is in the sequence because A093019(12)=5; 125 has a valid Luhn mod 10 check digit.
		

Crossrefs

Programs

  • Haskell
    a093025 n = a093025_list !! (n-1)
    a093025_list = filter ((== 5) . a093019) [0..]
    -- Reinhard Zumkeller, Nov 08 2014

Formula

A093019(a(n)) = 5. - Reinhard Zumkeller, Nov 08 2014

Extensions

Offset changed by Reinhard Zumkeller, Nov 08 2014

A093028 Indices of terms in A093019 with value 8.

Original entry on oeis.org

1, 15, 20, 39, 44, 58, 63, 77, 82, 96, 100, 119, 124, 138, 143, 157, 162, 176, 181, 195, 204, 218, 223, 237, 242, 256, 261, 275, 280, 299, 303, 317, 322, 336, 341, 355, 360, 379, 384, 398, 402, 416, 421, 435, 440, 459, 464, 478, 483, 497, 505, 510, 529, 534
Offset: 1

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Integers which require a following 8 to have a valid Luhn mod 10 check digit.

Examples

			15 is in the sequence because A093019(15)=8; 158 has a valid Luhn mod 10 check digit.
		

Crossrefs

Programs

  • Haskell
    a093028 n = a093028_list !! (n-1)
    a093028_list = filter ((== 8) . a093019) [0..]
    -- Reinhard Zumkeller, Nov 08 2014

Formula

A093019(a(n)) = 8. - Reinhard Zumkeller, Nov 08 2014

Extensions

Offset changed by Reinhard Zumkeller, Nov 08 2014

A093020 Indices of terms in A093019 with value 0.

Original entry on oeis.org

0, 19, 24, 38, 43, 57, 62, 76, 81, 95, 104, 118, 123, 137, 142, 156, 161, 175, 180, 199, 203, 217, 222, 236, 241, 255, 260, 279, 284, 298, 302, 316, 321, 335, 340, 359, 364, 378, 383, 397, 401, 415, 420, 439, 444, 458, 463, 477, 482, 496, 509, 514, 528, 533
Offset: 1

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Integers which require a following 0 to have a valid Luhn mod 10 check digit.

Examples

			19 is in the sequence because A093019(19)=0; 190 has a valid Luhn mod 10 check digit.
		

Crossrefs

Programs

  • Haskell
    a093020 n = a093020_list !! (n-1)
    a093020_list = filter ((== 0) . a093019) [0..]
    -- Reinhard Zumkeller, Nov 08 2014

Formula

A093019(a(n)) = 0. - Reinhard Zumkeller, Nov 08 2014

Extensions

Offset changed by Reinhard Zumkeller, Nov 08 2014

A093021 Indices of terms in A093019 with value 1.

Original entry on oeis.org

9, 14, 28, 33, 47, 52, 66, 71, 85, 90, 108, 113, 127, 132, 146, 151, 165, 170, 189, 194, 207, 212, 226, 231, 245, 250, 269, 274, 288, 293, 306, 311, 325, 330, 349, 354, 368, 373, 387, 392, 405, 410, 429, 434, 448, 453, 467, 472, 486, 491, 504, 518, 523, 537
Offset: 1

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Integers which require a following 1 to have a valid Luhn mod 10 check digit.

Examples

			14 is in the sequence because A093019(14)=1; 141 has a valid Luhn mod 10 check digit.
		

Crossrefs

Programs

  • Haskell
    a093021 n = a093021_list !! (n-1)
    a093021_list = filter ((== 1) . a093019) [0..]
    -- Reinhard Zumkeller, Nov 08 2014

Formula

A093019(a(n)) = 1. - Reinhard Zumkeller, Nov 08 2014

Extensions

Offset changed by Reinhard Zumkeller, Nov 08 2014

A093022 Indices of terms in A093019 with value 2.

Original entry on oeis.org

4, 18, 23, 37, 42, 56, 61, 75, 80, 99, 103, 117, 122, 136, 141, 155, 160, 179, 184, 198, 202, 216, 221, 235, 240, 259, 264, 278, 283, 297, 301, 315, 320, 339, 344, 358, 363, 377, 382, 396, 400, 419, 424, 438, 443, 457, 462, 476, 481, 495, 508, 513, 527, 532
Offset: 1

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Integers which require a following 2 to have a valid Luhn mod 10 check digit.

Examples

			18 is in the sequence because A093019(18)=2; 182 has a valid Luhn mod 10 check digit.
		

Crossrefs

Programs

  • Haskell
    a093022 n = a093022_list !! (n-1)
    a093022_list = filter ((== 2) . a093019) [0..]
    -- Reinhard Zumkeller, Nov 08 2014

Formula

A093019(a(n)) = 2. - Reinhard Zumkeller, Nov 08 2014

Extensions

Offset changed by Reinhard Zumkeller, Nov 08 2014

A093023 Indices of terms in A093019 with value 3.

Original entry on oeis.org

8, 13, 27, 32, 46, 51, 65, 70, 89, 94, 107, 112, 126, 131, 145, 150, 169, 174, 188, 193, 206, 211, 225, 230, 249, 254, 268, 273, 287, 292, 305, 310, 329, 334, 348, 353, 367, 372, 386, 391, 409, 414, 428, 433, 447, 452, 466, 471, 485, 490, 503, 517, 522, 536
Offset: 1

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Integers which require a following 3 to have a valid Luhn mod 10 check digit.

Examples

			13 is in the sequence because A093019(13)=3; 133 has a valid Luhn mod 10 check digit.
		

Crossrefs

Programs

  • Haskell
    a093023 n = a093023_list !! (n-1)
    a093023_list = filter ((== 3) . a093019) [0..]
    -- Reinhard Zumkeller, Nov 08 2014

Formula

A093019(a(n)) = 3. - Reinhard Zumkeller, Nov 08 2014

Extensions

Offset changed by Reinhard Zumkeller, Nov 08 2014

A093024 Indices of terms in A093019 with value 4.

Original entry on oeis.org

3, 17, 22, 36, 41, 55, 60, 79, 84, 98, 102, 116, 121, 135, 140, 159, 164, 178, 183, 197, 201, 215, 220, 239, 244, 258, 263, 277, 282, 296, 300, 319, 324, 338, 343, 357, 362, 376, 381, 395, 404, 418, 423, 437, 442, 456, 461, 475, 480, 499, 507, 512, 526, 531
Offset: 1

Views

Author

Ray Chandler, Apr 03 2004

Keywords

Comments

Integers which require a following 4 to have a valid Luhn mod 10 check digit.

Examples

			17 is in the sequence because A093019(17)=4; 174 has a valid Luhn mod 10 check digit.
		

Crossrefs

Programs

  • Haskell
    a093024 n = a093024_list !! (n-1)
    a093024_list = filter ((== 4) . a093019) [0..]
    -- Reinhard Zumkeller, Nov 08 2014

Formula

A093019(a(n)) = 4. - Reinhard Zumkeller, Nov 08 2014

Extensions

Offset changed by Reinhard Zumkeller, Nov 08 2014
Showing 1-10 of 12 results. Next