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.

A355679 For any nonnegative number n with primorial base expansion Sum_{k >= 0} d_k * A002110(k), a(n) = Sum_{k >= 0} d_k * A002110(k) * (-1)^(Sum_{i < k} sign(d_i)).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 14 2022

Keywords

Comments

This sequence establishes a bijection from the nonnegative integers (N) to the integers (Z).
This sequence is to primorial base what A065620 is to base 2.
To compute a(n): write n as a minimal sum of terms of A060735 and take the alternating sum.

Examples

			For n = 13:
  13 = 2*6 + 1,
  so a(13) = -2*6 + 1 = -11.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (v=0, f=1, s=1, d); forprime (r=2, oo, if (n==0, return (v), d=n%r; if (d, v+=d*f*s; s=-s); n\=r; f*=r)) }

Formula

a(n) = n iff n = 0 or n belongs to A060735.
Showing 1-1 of 1 results.