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-1 of 1 results.

A352112 In the primorial base expansion of n, replace each place value, say A002110(k) with k >= 0, by (-1)^k * A002110(k).

Original entry on oeis.org

0, 1, -2, -1, -4, -3, 6, 7, 4, 5, 2, 3, 12, 13, 10, 11, 8, 9, 18, 19, 16, 17, 14, 15, 24, 25, 22, 23, 20, 21, -30, -29, -32, -31, -34, -33, -24, -23, -26, -25, -28, -27, -18, -17, -20, -19, -22, -21, -12, -11, -14, -13, -16, -15, -6, -5, -8, -7, -10, -9, -60
Offset: 0

Views

Author

Rémy Sigrist, Mar 05 2022

Keywords

Comments

This sequence maps natural numbers uniquely onto integers.

Examples

			For n = 42:
- 42 = 1 * 5*3*2 + 2 * 3*2 + 0 * 2 + 0 * 1.
- so a(42) = 1 * -5*3*2 + 2 * 3*2 + 0 * -2 + 0 * 1 = -18.
		

Crossrefs

See A053985, A065369, A073835, A352111 for similar sequences.

Programs

  • PARI
    a(n) = { my (f=1, v=0); forprime (p=2, oo, if (n, v += f*(n%p); n\=p; f*=-p, return (v))) }
Showing 1-1 of 1 results.