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.

Previous Showing 11-14 of 14 results.

A257260 One-based position of the rightmost zero in the factorial base representation of n (A007623), 0 if no nonleading zeros present.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 3, 1, 3, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1
Offset: 1

Views

Author

Antti Karttunen, Apr 29 2015

Keywords

Comments

a(n) gives the distance of the rightmost zero from the right hand end of factorial base representation of n (A007623), particularly, 1 when n is even, and 0 for those cases when there are no nonleading zeros present (terms of A227157).
Sequence starts from n=1, to avoid ambiguities with case zero.

Examples

			For n = 1, with factorial base representation (A007623) "1", there are no nonleading zeros at all, thus a(1) = 0.
For n = 6, with representation "100", the rightmost zero occurs at digit-position 1 (when the least significant digit has index 1, etc.), thus a(6) = 1.
For n = 7, with representation "101", the rightmost zero occurs at position 2, thus a(7) = 2.
		

Crossrefs

Cf. A007623, A227157 (positions of zeros), A000012 (even bisection).
Cf. also A257261, A230403, and arrays of permutations A060117 and A060118.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r, s = {}, p}, While[{k, r} = QuotientRemainder[k, m]; k != 0|| r != 0, AppendTo[s, r]; m++]; If[MissingQ[(p = FirstPosition[s, 0])], 0, p[[1]]]]; Array[a, 100] (* Amiram Eldar, Feb 07 2024 *)
  • Scheme
    (define (A257260 n) (let loop ((n n) (i 2)) (cond ((zero? n) 0) ((zero? (modulo n i)) (- i 1)) (else (loop (floor->exact (/ n i)) (+ 1 i))))))

A339012 Written in factorial base, n ends in a(n) consecutive non-0 digits.

Original entry on oeis.org

0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0, 3, 0, 1, 0, 3, 0, 3, 0, 1, 0, 3, 0, 3, 0, 1, 0, 2, 0, 2, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 2, 0, 2, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 4, 0, 4, 0, 1, 0, 2, 0, 2, 0, 1, 0, 4, 0, 4, 0, 1, 0
Offset: 0

Views

Author

Kevin Ryde, Nov 19 2020

Keywords

Comments

Also, a(n) is the least p for which n mod (p+2)! < (p+1)!. A small remainder like this means a 0 digit at position p in the factorial base representation of n, where the least significant digit is position p=0. The least such p means only nonzero digits below.
Those n with a(n)=p are characterized by remainders n mod (p+2)!, per the formula below. These remainders are terms of A227157 which is factorial base digits all nonzero. A227157 can be taken by rows where row p lists the terms having p digits in factorial base. Each digit ranges from 1 up to 1,2,3,... respectively so there are p! values in a row, and so the asymptotic density of terms p here is p!/(p+2)! = 1/((p+2)*(p+1)) = 1/A002378(p+1) = 1/2, 1/6, etc.
The smallest n with a(n)=p is the factorial base repunit n = 11..11 with p 1's = A007489(p).

Examples

			n = 10571 written in factorial base is 2,0,4,0,1,2,1.  It ends in 3 consecutive nonzero digits (1,2,1) so a(10571) = 3.  Remainder 10571 mod (3+2)! = 11 is in A227157 row 3.
		

Crossrefs

Cf. A108731 (factorial base digits), A016921 (where a(n)=1), A339013 (+2), A230403 (ending 0's).
In other bases: A215887, A328570.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, r}, While[{k, r} = QuotientRemainder[k, m]; r != 0, m++]; m - 2]; Array[a, 30, 0] (* Amiram Eldar, Feb 15 2021 after Kevin Ryde's PARI code *)
  • PARI
    a(n) = my(b=2,r); while([n,r]=divrem(n,b);r!=0, b++); b-2;

Formula

a(n)=p iff n mod (p+2)! is a term in row p of A227157 (row p terms having p digits), including p=0 by reckoning an initial A227157(0) = 0 as no digits.
a(n)=0 iff n mod 2 = 0.
a(n)=1 iff n mod 6 = 1, which is A016921.
a(n)=2 iff n mod 24 = 3 or 5.

A231715 For n with a unique factorial base representation n = du*u! + ... + d2*2! + d1*1! (each di in range 0..i, cf. A007623), a(n) = Product_{i=1..u} (gcd(d_i,i+1) mod i+1), where u is given by A084558(n).

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2
Offset: 1

Views

Author

Antti Karttunen, Nov 12 2013

Keywords

Examples

			For n=13, with factorial base representation '201' (= A007623(13), 2*3! + 0*2! + 1*1! = 13) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(0,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(3 mod 3)*(2 mod 4) = 1*0*2 = 0, thus a(13)=0.
For n=17, with factorial base representation '221' (= A007623(17), 2*3! + 2*2! + 1*1! = 17) we have, starting from the least significant digit, (gcd(1,2) mod 2)*(gcd(2,3) mod 3)*(gcd(2,4) mod 4) = (1 mod 2)*(1 mod 3)*(2 mod 4) = 1*1*2 = 2, thus a(17)=2.
		

Crossrefs

Cf. A231716 (positions of ones), A227157 (the positions of nonzero terms), A007623.
Each a(n) <= A208575(n).

Programs

  • Scheme
    (define (A231715 n) (let loop ((n n) (i 2) (p 1)) (cond ((zero? n) p) (else (loop (floor->exact (/ n i)) (+ i 1) (* p (modulo (gcd (modulo n i) i) i)))))))

A304116 Numbers k such that A304036(k) = 2.

Original entry on oeis.org

2, 4, 7, 10, 13, 16, 19, 22, 27, 29, 34, 37, 40, 43, 46, 51, 53, 58, 61, 64, 67, 70, 75, 77, 82, 85, 88, 91, 94, 99, 101, 106, 109, 112, 115, 118, 129, 131, 135, 137, 141, 143, 154, 157, 160, 163, 166, 171, 173, 178, 181, 184, 187, 190, 195, 197, 202, 205, 208, 211, 214
Offset: 1

Views

Author

Seiichi Manyama, May 06 2018

Keywords

Examples

			n | a(n) |
--+------+-------------------
1 |   2  | 2, 1+1
2 |   4  | 2+2, 2+1+1
3 |   7  | 6+1, 2+2+2+1
4 |  10  | 6+2+2, 6+2+1+1
5 |  13  | 6+6+1, 6+2+2+2+1
6 |  16  | 6+6+2+2, 6+6+2+1+1
		

Crossrefs

Cf. A227157 (A304036(k) = 1), A304036.
Previous Showing 11-14 of 14 results.