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

A213636 Remainder when n is divided by its least nondivisor.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jun 16 2012

Keywords

Comments

Experimentation suggests that every positive integer occurs in this sequence and that
2 occurs only in even numbered positions,
3 occurs in only in positions that are multiples of 12,
4 occurs only in positions that are multiples of 12,
5 occurs only in positions that are multiples of 60,
6 occurs only in positions that are multiples of 60,
7 occurs only in positions that are multiples of 2520, etc.
See A213637 for positions of 1 and A213638 for positions of 2.
From Robert Israel, Jul 28 2017: (Start)
Given any positive number m, let q be a prime > m and r = A003418(q-1). Then a(n) = m if n == m (mod q) and n == 0 (mod r). By the Chinese Remainder Theorem, such n exists.
On the other hand, if a(n) = m, we must have A007978(n) > m, and then n must be divisible by A003418(q-1) where q = A007978(n) is a member of A000961 greater than m. Moreover, if q=p^j with j>1, n is divisible by p^(j-1) so m must be divisible by p^(j-1). Thus:
For m=2, A003418(2)=2.
For m=3, A007978(n) can't be 4 because m is odd, so A007978(n)>= 5 and n must be divisible by A003418(4)=12.
For m=4, A003418(4)=12.
For m=5 or 6, A003418(6)=60.
For m=7, A007978(n) can't be 8 because m is odd, and can't be 9 because m is not divisible by 3, so n must be divisible by A003418(10)=2520. (End)

Examples

			a(10) = 10-3*[10/3] = 1.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      for k from 2 do if n mod k <> 0 then return n mod k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 27 2017
  • Mathematica
    y=120; z=2000;
    t = Table[k := 1; While[Mod[n, k] == 0, k++];
       k, {n, 1, z}]  (*A007978*)
    Table[Floor[n/t[[n]]], {n, 1, y}] (*A213633*)
    Table[n - Floor[n/t[[n]]], {n, 1, y}] (*A213634*)
    Table[t[[n]]*Floor[n/t[[n]]], {n, 1, y}] (*A213635*)
    t1 = Table[n - t[[n]]*Floor[n/t[[n]]],
       {n, 1, z}] (* A213636 *)
    Flatten[Position[t1, 1]] (* A213637 *)
    Flatten[Position[t1, 2]] (* A213638 *)
    rem[n_]:=Module[{lnd=First[Complement[Range[n],Divisors[n]]]},Mod[n,lnd]]; Join[{1,2},Array[rem,100,3]] (* Harvey P. Dale, Mar 26 2013 *)
    Table[Mod[n, SelectFirst[Range[n + 1], ! Divisible[n, #] &]], {n, 105}] (* Michael De Vlieger, Jul 29 2017 *)
  • Python
    def a(n):
        k=2
        while n%k==0: k+=1
        return n%k
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jul 28 2017
    
  • Python
    def A213636(n): return next(filter(None, (n%d for d in range(2,n)))) if n>2 else n # Chai Wah Wu, Feb 22 2023
  • Scheme
    (define (A213636 n) (modulo n (A007978 n))) ;; Antti Karttunen, Jul 27 2017
    

Formula

a(n) = n - A213635(n).
a(n) = n - m(n)*floor(n/m(n)), where m(n) = A007978(n).

A213634 n-[n/m], where m is the least nondivisor of n (as in A007978) and [ ] = floor.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jun 16 2012

Keywords

Comments

If n is odd, a(n) = (n+1)/2. - Robert Israel, Oct 09 2016

Examples

			a(10) = 10 - [10/3] = 7.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m;
           for m from 2 do if n mod m <> 0 then return n - iquo(n,m) fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 09 2016
  • Mathematica
    (See A213633.)

A213635 m*[n/m], where m is the least nondivisor of n (as in A007978) and [ ] = floor.

Original entry on oeis.org

0, 0, 2, 3, 4, 4, 6, 6, 8, 9, 10, 10, 12, 12, 14, 15, 16, 16, 18, 18, 20, 21, 22, 20, 24, 24, 26, 27, 28, 28, 30, 30, 32, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 45, 48, 48, 50, 51, 52, 52, 54, 54, 56, 57, 58, 56, 60, 60, 62, 63, 64, 64, 66, 66, 68
Offset: 1

Views

Author

Clark Kimberling, Jun 16 2012

Keywords

Crossrefs

Cf. A213633.

Programs

  • Mathematica
    (See A213633.)
  • Python
    def A213635(n): return n-next(filter(None, (n%d for d in range(2,n)))) if n>2 else 0 # Chai Wah Wu, Feb 22 2023

A331902 T(n, k) = floor(n/m) where m is the least positive integer such that floor(n/m) = floor(k/m). Square array read by antidiagonals, for n >= 0 and k >= 0.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 31 2020

Keywords

Comments

For any n > 0, the n-th row has A001651(n) nonzero terms.

Examples

			Array T(n, k) begins (with dots instead of 0's for readability):
   n\k|   0   1   2   3   4   5   6   7   8   9  10  11  12
   ---+----------------------------------------------------
     0|   .   .   .   .   .   .   .   .   .   .   .   .   .
     1|   .   1   .   .   .   .   .   .   .   .   .   .   .
     2|   .   .   2   1   .   .   .   .   .   .   .   .   .
     3|   .   .   1   3   1   1   .   .   .   .   .   .   .
     4|   .   .   .   1   4   2   1   1   .   .   .   .   .
     5|   .   .   .   1   2   5   1   1   1   1   .   .   .
     6|   .   .   .   .   1   1   6   3   2   1   1   1   .
     7|   .   .   .   .   1   1   3   7   2   1   1   1   1
     8|   .   .   .   .   .   1   2   2   8   4   2   2   1
     9|   .   .   .   .   .   1   1   1   4   9   3   3   1
    10|   .   .   .   .   .   .   1   1   2   3  10   5   2
    11|   .   .   .   .   .   .   1   1   2   3   5  11   2
    12|   .   .   .   .   .   .   .   1   1   1   2   2  12
		

Crossrefs

Programs

  • PARI
    T(n,k) = for (x=1, oo, if (n\x==k\x, return (n\x)))

Formula

T(n, k) = floor(n/A331886(n, k)) = floor(k/A331886(n, k)).
T(n, k) = T(k, n).
T(n, k) = 0 iff max(n, k) >= 2*min(n, k).
T(n, n+1) = A213633(n+1).
Showing 1-4 of 4 results.