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.

User: Tejo Vrush

Tejo Vrush's wiki page.

Tejo Vrush has authored 13 sequences. Here are the ten most recent ones:

A350654 Smallest k such that A349949(k) = n, or -1 if no such k exists.

Original entry on oeis.org

2, 3, 8, 15, 63, 120, 440, 945, 2079, 4095, 21735, 98175, 133056, 395199, 338625, 1890945, 3501576, 8390304, 35820225, 126775935, 149848335, 879207616, 302464800
Offset: 1

Author

Tejo Vrush, Jan 09 2022

Keywords

Comments

a(25) = 879207615. - Chai Wah Wu, Jan 13 2022

Crossrefs

Programs

  • PARI
    f(n) = my(sd=setunion(divisors(n-1), divisors(n+1))); sumdiv(n, d, (vecsearch(sd, d-1)>0) || (vecsearch(sd, d+1)>0)); \\ A349949
    a(n) = my(k=2); while (f(k) != n, k++); k; \\ Michel Marcus, Jan 10 2022
    
  • Python
    from itertools import count
    from sympy import divisors
    def A350654(n):
        for m in count(2):
            c = 0
            for d in divisors(m,generator=True):
                if not (((m-1) % (d-1) if d > 1 else True) and (m-1) % (d+1) and ((m+1) % (d-1) if d > 1 else True) and (m+1) % (d+1)):
                    c += 1
                    if c > n:
                        break
            if c == n:
                return m # Chai Wah Wu, Jan 12 2022

Extensions

a(11)-a(19) from Jinyuan Wang, Jan 10 2022
Escape clause value changed to -1 by N. J. A. Sloane, Jan 12 2022
a(20)-a(21) from Chai Wah Wu, Jan 12 2022
a(22)-a(23) from Chai Wah Wu, Jan 13 2022

A350540 a(n) = smallest number x such that x^2 == 17 (mod 2^n).

Original entry on oeis.org

0, 1, 1, 1, 1, 7, 9, 23, 23, 23, 233, 279, 279, 1769, 1769, 6423, 9961, 9961, 55575, 55575, 206569, 206569, 842007, 1255145, 2939159, 2939159, 2939159, 2939159, 64169705, 64169705, 204265751, 204265751, 869476073, 869476073, 3425491223, 3425491223, 13754377961
Offset: 0

Author

Tejo Vrush, Jan 04 2022

Keywords

Comments

17 is the smallest nonsquare that is congruent to a square mod 2^n for any n.
Any number that is congruent to a square mod 2^n for any n is of the form (4^a)*(8b+1). Such numbers have density 1/6.

Crossrefs

Programs

  • Mathematica
    Table[PowerMod[17,1/2,2^k],{k,0,36}] (* Giorgos Kalogeropoulos, Jan 31 2023 *)
  • PARI
    a(n) = my(x=0); while (Mod(x, 2^n)^2 != 17, x++); x; \\ Michel Marcus, Jan 04 2022
    
  • Python
    from sympy.ntheory import sqrt_mod
    def A350540(n): return min(sqrt_mod(17,2**n,all_roots=True)) # Chai Wah Wu, Jan 12 2022

Extensions

a(13)-a(28) from Michel Marcus, Jan 04 2022
a(30)-a(36) from Alois P. Heinz, Jan 04 2022
Edited by N. J. A. Sloane, Jan 12 2022

A349949 a(n) is the number of divisors of n that are 1 above or 1 below a divisor of either n+1 or n-1.

Original entry on oeis.org

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

Author

Tejo Vrush, Dec 06 2021

Keywords

Examples

			a(2) = 1 because 2 and 0 are not divisors of either 1 or 3, but 3 = 2+1 is a divisor of 3.
a(6) = 2 since the divisors of 6 are 1, 2, 3, and 6; those of 5 are 1 and 5; those of 7 are 1 and 7; and, regarding {1, 5, 7}, neither 1-1 = 0 nor 1+1 = 2 are in the set, neither 3-1 = 2 nor 3+1 = 4 is, but 2-1 = 1 is, and 6-1 = 5 is (as is 6+1 = 7).
		

Crossrefs

Cf. A000005.

Programs

  • Mathematica
    Table[DivisorSum[n, 1 &, If[# == 1, Or[Mod[n - 1, # + 1] == 0, Mod[n + 1, # + 1] == 0], AnyTrue[# + {-1, 1}, Or[Mod[n - 1, #] == 0, Mod[n + 1, #] == 0] &]] &], {n, 2, 88}] (* Michael De Vlieger, Dec 06 2021 *)
  • PARI
    a(n) = my(sd=setunion(divisors(n-1), divisors(n+1))); sumdiv(n, d, (vecsearch(sd, d-1)>0) || (vecsearch(sd, d+1)>0)); \\ Michel Marcus, Dec 07 2021
  • Python
    from sympy import divisors
    def aupton(nn):
        alst, prevdivs, divs, nextdivs = [], set(), {1}, {1, 2}
        for n in range(2, nn+1):
            prevdivs, divs, nextdivs = divs, nextdivs, set(divisors(n+1))
            neighdivs = prevdivs | nextdivs
            an = sum(1 for d in divs if {d-1, d+1} & neighdivs != set())
            alst.append(an)
        return alst
    print(aupton(88)) # Michael S. Branicky, Dec 06 2021
    
  • Python
    def A349949(n): return sum(1 for m in filter(lambda d:not (((n-1) % (d-1) if d > 1 else True) and (n-1) % (d+1) and ((n+1) % (d-1) if d > 1 else True) and (n+1) % (d+1)), divisors(n,generator=True))) # Chai Wah Wu, Dec 30 2021
    

Formula

a(p) = 2 for odd prime p. - Chai Wah Wu, Dec 30 2021

Extensions

a(6), a(12), a(14), a(18) corrected and a(31) and beyond from Michael S. Branicky, Dec 06 2021

A349521 Numbers k such that A348172(k) = 1.

Original entry on oeis.org

4, 16, 20, 28, 32, 36, 44, 48, 52, 64, 68, 72, 76, 92, 100, 108, 112, 116, 124, 140, 144, 148, 160, 164, 172, 176, 180, 188, 192, 196, 208, 212, 216, 220, 224, 236, 240, 244, 252, 256, 260, 268, 272, 284, 292, 304, 308, 316, 320, 332, 336, 340, 352, 356, 360, 364, 368, 380, 388, 396, 400
Offset: 1

Author

Tejo Vrush, Nov 20 2021

Keywords

Crossrefs

Cf. A348172.
Similar sequences: A349467.

Programs

  • Mathematica
    Block[{nn = 9, m, s}, m = 2^(2 nn); s = KeySort@ PositionIndex[Array[DivisorSigma[0, #]/# &, m]]; s = Reverse@ KeyDrop[s, TakeWhile[Keys@ s, 4/#^2 > m &]]; Position[Length /@ Array[Lookup[s, DivisorSigma[0, #]/#] &, 2^nn], 1][[All, 1]]] (* Michael De Vlieger, Dec 06 2021 *)
  • PARI
    isok(k) = my(q=numdiv(k)/k); sum(i=1, 4/q^2, numdiv(i)/i == q) == 1; \\ Michel Marcus, Nov 20 2021

A349467 Numbers k such that A349410(k) = 1.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 8, 9, 11, 13, 17, 19, 21, 23, 25, 28, 29, 31, 32, 33, 36, 37, 39, 40, 41, 43, 47, 48, 49, 51, 53, 57, 59, 61, 67, 69, 70, 71, 73, 75, 79, 81, 83, 87, 89, 90, 93, 96, 97, 98, 101, 103, 107, 109, 110, 111, 113, 120, 121, 123, 126, 127, 128, 129, 130
Offset: 1

Author

Tejo Vrush, Nov 18 2021

Keywords

Comments

Does this sequence have density 1/3? This sequence has infinitely many terms because every prime number is a term.
The numbers of terms not exceeding 10^k for k = 1, 2, ... are 8, 50, 396, 3566, 33943, 332042, 3297317, 32983277, ... Apparently this sequence has an asymptotic density of about 0.33. - Amiram Eldar, Nov 18 2021

Crossrefs

Cf. A349410.

Programs

  • Mathematica
    a[n_] := Module[{s = NestWhileList[n*DivisorSigma[0, #] &, 1, UnsameQ, All]}, Differences[Position[s, s[[-1]]]][[1, 1]]]; Select[Range[130], a[#] == 1 &] (* Amiram Eldar, Nov 18 2021 *)

A349483 Length of cycle reached when iterating the mapping x-> n*A035116(x) on 1.

Original entry on oeis.org

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

Author

Tejo Vrush, Nov 19 2021

Keywords

Comments

The terms 1-25 all appear below 10^8; the last of these are a(12545280) = 21, a(12684672) = 24, and a(96940800) = 25. - Charles R Greathouse IV, Nov 23 2021

Examples

			For n = 2, 1 --> 2 --> 8 --> 32 --> 72 --> 288 --> 648 --> 800 --> 648. The cycle reached has just two terms: 648 and 800. Therefore, a(2) = 2.
		

Crossrefs

Cf. A035116.
Similar sequences: A349410.

Programs

  • Mathematica
    a[n_] := Module[{s = NestWhileList[n*DivisorSigma[0, #]^2 &, 1, UnsameQ, All]}, Differences[Position[s, s[[-1]]]][[1, 1]]]; Array[a, 100] (* Amiram Eldar, Nov 19 2021 *)
  • PARI
    brent(f,x)=my(pow=1,lam=1,tortoise=x,hare=f(x)); while(tortoise!=hare, if(pow==lam, tortoise=hare; pow<<=1; lam=0); hare=f(hare); lam++); lam
    a(n)=brent(k->n*numdiv(k)^2,1) \\ Charles R Greathouse IV, Nov 19 2021

A349428 Smallest k such that A349410(k) = n or -1 if no such number exists.

Original entry on oeis.org

1, 4, 15, 30, 42, 360, 196, 525, 2080, 320, 7168, 123200, 35200, 150920, 196000, 1232000, 61236, 466560, 106831872, 49787136, 14580000, 155648000, 94058496, 123561984, 47385000
Offset: 1

Author

Tejo Vrush, Nov 17 2021

Keywords

Crossrefs

Cf. A349410.
Similar sequences: A005179, A348184.

Programs

  • Mathematica
    f[n_] := Module[{s = NestWhileList[n * DivisorSigma[0, #] &, 1, UnsameQ, All]}, Differences[Position[s, s[[-1]]]][[1, 1]]]; seq[len_, nmax_] := Module[{v = Table[0, {len}], n = 1, c = 0, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && v[[i]] == 0, c++; v[[i]] = n]; n++]; TakeWhile[v, # > 0 &]]; seq[15, 10^6] (* Amiram Eldar, Nov 17 2021 *)

Extensions

Escape clause value changed to -1. - N. J. A. Sloane, Jan 14 2022

A349410 Length of cycle reached when iterating the mapping x-> n*A000005(x) on 1.

Original entry on oeis.org

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

Author

Tejo Vrush, Nov 16 2021

Keywords

Examples

			For n = 9, 1 --> 9 --> 27 --> 36 --> 81 --> 45 --> 54 --> 72 --> 108 --> 108. The cycle reached has just one term: 108. Therefore, a(9) = 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{s = NestWhileList[n * DivisorSigma[0, #] &, 1, UnsameQ, All]}, Differences[Position[s, s[[-1]]]][[1, 1]]]; Array[a, 100] (* Amiram Eldar, Nov 17 2021 *)
  • PARI
    f(n, x) = n*numdiv(x);
    find(nm, v) = {forstep (n=#v-1, 1, -1, if (v[#v] == v[n], return(#v-n);););}
    a(n) = {my(list = List(), found=0, m=n); listput(list, m); while (! found, my(nm = f(n, m)); listput(list, nm); found = find(nm, list); m = nm;); found;} \\ Michel Marcus, Nov 17 2021
  • Python
    from sympy import divisor_count
    terms = []
    for n in range(1, 101):
        s, t = [1], True
        while t:
            for i in range(2, len(s)):
                if s[-i] == s[-1]:
                    t = False
                    terms.append(i - 1)
                    break
            s.append(n*divisor_count(s[-1]))
    print(terms) # Gleb Ivanov, Nov 17 2021
    

Formula

a(A000040(n)) = 1.

A348568 Highly composite numbers (A002182) such that the exponents of 2 and 3 in their prime factorization are equal.

Original entry on oeis.org

1, 6, 36, 180, 1260, 7560, 45360, 83160, 498960, 1081080, 6486480, 32432400, 110270160, 551350800, 2095133040, 10475665200, 73329656400, 240940299600, 1686582097200, 48910880818800, 1516237305382800
Offset: 1

Author

Tejo Vrush, Oct 27 2021

Keywords

Comments

These are all the terms in the sequence because for a number x that has exponents of 2 and 3 equal and >= 5 in its prime factorization, 8x/9 is a smaller number with at least the same number of divisors. Since 1516237305382800 is the greatest highly composite number that is not a multiple of 32, A134592(32), it is the last term of this sequence.

Examples

			1516237305382800 is highly composite and its prime factorization is 2^4 * 3^4 * 5^2 * 7^2 * 11 * 13 * 17 * 19 * 23 * 29 * 31. Since the exponents of 2 and 3 are both 4, 1516237305382800 is in this sequence.
		

Crossrefs

Programs

  • Mathematica
    HCN = Import["https://oeis.org/A002182/b002182.txt", "Table"][[;; , 2]]; Select[HCN, IntegerExponent[#, 2] == IntegerExponent[#, 3] &] (* Amiram Eldar, Oct 27 2021 *)

Formula

Intersection of A002182 and A064615.

A348532 a(n) is the number of multisets of integers that are possible to reach by starting with n occurrences of 0 and by splitting and reverse splitting.

Original entry on oeis.org

1, 1, 2, 2, 7, 9, 43, 59, 338, 490, 3097, 4639, 31283, 48107, 338553, 531469, 3857036, 6157068, 45713546, 73996100
Offset: 0

Author

Tejo Vrush, Oct 21 2021

Keywords

Comments

Splitting is taking 2 occurrences of the same integer and incrementing one of them by 1 and decrementing the other occurrence by 1.
Reverse splitting is taking two elements with a difference of 2 and incrementing the smaller one by 1 and decrementing the larger one by 1. It is the opposite of splitting.

Examples

			For n = 5, the multisets are as follows:
  {{0,0,0,0,0}}   {{-1,0,0,0,1}}   {{-1,-1,0,1,1}}
  {{-1,-1,0,0,2}} {{-1,-1,-1,1,2}} {{-2,0,0,1,1}}
  {{-2,0,0,0,2}}  {{-2,-1,1,1,1}}  {{-2,-1,0,1,2}}.
  Therefore, a(5) = 9.
For n = 6, the multisets are as follows:
  {{0,0,0,0,0,0}}     {{-1,0,0,0,0,1}}     {{-1,-1,0,0,1,1}}
  {{-1,-1,0,0,0,2}}   {{-1,-1,-1,1,1,1}}   {{-1,-1,-1,0,1,2}}
  {{-1,-1,-1,0,0,3}}* {{-1,-1,-1,-1,2,2}}* {{-1,-1,-1,-1,1,3}}*
  {{-2,0,0,0,1,1}}    {{-2,0,0,0,0,2}}     {{-2,-1,0,1,1,1}}
  {{-2,-1,0,0,1,2}}   {{-2,-1,0,0,0,3}}*   {{-2,-1,-1,1,1,2}}
  {{-2,-1,-1,0,2,2}}  {{-2,-1,-1,0,1,3}}   {{-2,-1,-1,-1,2,3}}*
  {{-2,-2,1,1,1,1}}*  {{-2,-2,0,1,1,2}}    {{-2,-2,0,0,2,2}}
  {{-2,-2,0,0,1,3}}   {{-2,-2,-1,1,2,2}}   {{-2,-2,-1,1,1,3}}
  {{-2,-2,-1,0,2,3}}  {{-2,-2,-2,2,2,2}}*  {{-2,-2,-2,1,2,3}}*
  {{-3,0,0,0,0,3}}*   {{-3,0,0,0,1,2}}*    {{-3,0,0,1,1,1}}*
  {{-3,-1,1,1,1,1}}*  {{-3,-1,0,1,1,2}}    {{-3,-1,0,0,2,2}}
  {{-3,-1,0,0,1,3}}   {{-3,-1,-1,1,2,2}}   {{-3,-1,-1,1,1,3}}
  {{-3,-1,-1,0,2,3}}  {{-3,-2,1,1,1,2}}*   {{-3,-2,0,1,2,2}}
  {{-3,-2,0,1,1,3}}   {{-3,-2,0,0,2,3}}    {{-3,-2,-1,2,2,2}}*
  {{-3,-2,-1,1,2,3}}.
  Therefore, a(6) = 43.
The ones marked with an asterisk are the ones that need reverse splitting
to be reached. They are not produced using the rules of A347913.
		

Crossrefs

Programs

  • Python
    def nextq(q):
        used, used2 = set(), set()
        for i in range(len(q)-1):
            for j in range(i+1, len(q)):
                if q[i] == q[j]:
                    if q[i] in used: continue
                    used.add(q[i])
                    qc = list(q); qc[i] -= 1; qc[j] += 1
                    yield tuple(sorted(qc))
                elif q[j] - q[i] == 2:  # assumes q is sorted
                    if q[i] in used2: continue
                    used2.add(q[i])
                    qc = list(q); qc[i] += 1; qc[j] -= 1
                    yield tuple(sorted(qc))
    def a(n):
        s = tuple(0 for i in range(n)); reach = {s}; expand = list(reach)
        while len(expand) > 0:
            q = expand.pop()
            for qq in nextq(q):
                if qq not in reach:
                    reach.add(qq)
                    expand.append(qq)
        return len(reach)
    print([a(n) for n in range(13)]) # Michael S. Branicky, Oct 21 2021

Formula

It appears that a(n) = A000571(n) for odd n.

Extensions

a(6)-a(19) from Michael S. Branicky, Oct 21 2021