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

A338039 Numbers m such that A338038(m) = A338038(A004086(m)) where A004086(i) is i read backwards and A338038(i) is the sum of the primes and exponents in the prime factorization of i ignoring 1-exponents; palindromes and multiples of 10 are excluded.

Original entry on oeis.org

18, 81, 198, 576, 675, 819, 891, 918, 1131, 1304, 1311, 1818, 1998, 2262, 2622, 3393, 3933, 4031, 4154, 4514, 4636, 6364, 8181, 8749, 8991, 9478, 12441, 14269, 14344, 14421, 15167, 15602, 16237, 18018, 18449, 18977, 19998, 20651, 23843, 24882, 26677, 26892, 27225
Offset: 1

Views

Author

Michel Marcus, Oct 08 2020

Keywords

Comments

Palindromes (A002113) are excluded from the sequence because they obviously satisfy the condition.
Sequence is infinite since it includes 18, 1818, 181818, .... See link.
There are many cases of terms that are the repeated concatenation of integers like: 1818, 8181, 181818, ... , but also 131313131313131313131313131313 and more. See A338166.
If n is in the sequence and has d digits, and gcd(n, x) = gcd(A004086(n), x) where x = (10^((k+1)*d)-1)/(10^d-1), then the concatenation of k copies of n is also in the sequence. - Robert Israel, Oct 13 2020

Examples

			For m = 18 = 2*3^2, A338038(18) = 2 + (3+2) = 7 and for m = 81 = 3^4, A338038(81) = 7, so 18 and 81 are terms.
		

Crossrefs

Cf. A004086 (read n backwards), A002113, A029742 (non-palindromes), A338038, A338166.

Programs

  • Maple
    rev:= proc(n) local L,i;
      L:= convert(n,base,10);
      add(L[-i]*10^(i-1),i=1..nops(L))
    end proc:
    g:= proc(n) local t;
      add(t[1]+t[2],t=subs(1=0,ifactors(n)[2]))
    end proc:
    filter:= proc(n) local r;
      if n mod 10 = 0 then return false fi;
      r:= rev(n);
      r <> n and g(r)=g(n)
    end proc:
    select(filter, [$1..30000]); # Robert Israel, Oct 13 2020
  • Mathematica
    s[1] = 0; s[n_] := Plus @@ First /@ (f = FactorInteger[n]) + Plus @@ Select[Last /@ f, # > 1 &]; Select[Range[30000], !Divisible[#, 10] && (r = IntegerReverse[#]) != # &&  s[#] == s[r] &] (* Amiram Eldar, Oct 08 2020 *)
  • PARI
    f(n) = my(f=factor(n)); vecsum(f[,1]) + sum(k=1, #f~, if (f[k,2]!=1, f[k,2])); \\ A338038
    isok(m) = my(r=fromdigits(Vecrev(digits(m)))); (m % 10) && (m != r) && (f(r) == f(m));

A141276 a(n) = A338038(A002808(n)).

Original entry on oeis.org

4, 5, 5, 5, 7, 7, 9, 8, 6, 7, 9, 10, 13, 8, 7, 15, 6, 11, 10, 7, 14, 19, 12, 9, 21, 16, 10, 12, 15, 10, 25, 9, 9, 9, 20, 17, 8, 16, 12, 22, 31, 12, 33, 12, 8, 18, 16, 21, 26, 14, 10, 39, 10, 23, 18, 18, 11, 7, 43, 14, 22, 45, 32, 16, 12, 20, 27, 34, 49, 24, 10, 11, 16, 11, 22, 18, 15, 55
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 08 2008

Keywords

Examples

			Let k(n) = n-th composite (A002808(n)). Then:
a(4)=5 because k(4) = 9 = 3^2 and 5=3+2;
a(9)=6 because k(9) = 16 = 2^4 and 6=2+4;
a(10)=7 because k(10) = 18 = 2*3^2 and 7=2+3+2.
		

Crossrefs

Programs

  • Maple
    A141276 := proc(n) local a, ifs, p, c ; if not isprime(n) then a := 0 ; ifs := ifactors(n)[2] ; for p in ifs do a := a + op(1,p) ; if op(2,p) > 1 then a := a+ op(2,p) ; fi; od: printf("%d,",a) ; end if; return ; end: for n from 4 to 200 do A141276(n); end do; # R. J. Mathar, Apr 28 2010
  • Mathematica
    a[n_] := Plus @@ First /@ (f = FactorInteger[n]) + Plus @@ Select[Last /@ f, # > 1 &];a/@Select[Range[106], CompositeQ] (* James C. McMahon, Jul 19 2025 *)

Extensions

Entries checked by R. J. Mathar, Apr 28 2010
Edited (with clearer definition) by N. J. A. Sloane, Jun 15 2021

A381202 a(n) is the sum of the elements of the set of bases and exponents (including exponents = 1) in the prime factorization of n.

Original entry on oeis.org

0, 3, 4, 2, 6, 6, 8, 5, 5, 8, 12, 6, 14, 10, 9, 6, 18, 6, 20, 8, 11, 14, 24, 6, 7, 16, 3, 10, 30, 11, 32, 7, 15, 20, 13, 5, 38, 22, 17, 11, 42, 13, 44, 14, 11, 26, 48, 10, 9, 8, 21, 16, 54, 6, 17, 13, 23, 32, 60, 11, 62, 34, 13, 8, 19, 17, 68, 20, 27, 15, 72, 5
Offset: 1

Views

Author

Paolo Xausa, Feb 16 2025

Keywords

Comments

The prime factorization of 1 is the empty set, so a(1) = 0 by convention (empty sum).

Examples

			a(12) = 6 because 12 = 2^2*3^1, the set of these bases and exponents is {1, 2, 3} and 1 + 2 + 3 = 6.
a(31500) = 18 because 31500 = 2^2*3^2*5^3*7^1, the set of these bases and exponents is {1, 2, 3, 5, 7} and 1 + 2 + 3 + 5 + 7 = 18.
		

Crossrefs

Programs

  • Mathematica
    A381202[n_] := If[n == 1, 0, Total[Union[Flatten[FactorInteger[n]]]]];
    Array[A381202, 100]
  • PARI
    a(n) = my(f=factor(n)); vecsum(setunion(Set(f[,1]), Set(f[,2]))); \\ Michel Marcus, Feb 18 2025

A338166 Terms of A338039 that are repeated concatenations of smaller integers.

Original entry on oeis.org

1818, 8181, 181818, 198198, 405405, 484848, 504504, 565656, 576576, 656565, 675675, 818181, 848484, 891891, 11311131, 13041304, 13111311, 18181818, 19981998, 22622262, 26222622, 33933393, 39333933, 40314031, 41544154, 45144514, 46364636, 63646364, 81818181, 87498749, 89918991, 94789478
Offset: 1

Views

Author

Michel Marcus, Oct 14 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Block[{f}, f[1] = 0; f[n_] := Plus @@ #[[All, 1]] + Plus @@ Select[#[[All, -1]], # > 1 &] &@ FactorInteger[n]; Select[Union@ Flatten@ Table[Union@ Flatten@ Map[Function[k, Map[FromDigits[Join @@ ConstantArray[IntegerDigits[#], n/k]] &, Range[10^(k - 1), 10^k - 1]]], Most@ Divisors[n]], {n, 3, 8}], And[Mod[#1, 10] != 0, #2 != #1, f[#1] == f[#2]] & @@ {#, IntegerReverse[#]} &] ] (* Michael De Vlieger, May 27 2021, after Amiram Eldar at A338039 *)
  • PARI
    f(n) = my(f=factor(n)); vecsum(f[,1]) + sum(k=1, #f~, if (f[k,2]!=1, f[k,2])); \\ A338038
    isok(m) = my(r=fromdigits(Vecrev(digits(m)))); if ((r != m) && (f(r) == f(m)), return(m));
    listc(c) = {my(list = List()); fordiv(c, d, if ((d != 1) && (d != c), for(k=10^(d-1), 10^d, if (k % 10, my(sk = Str(k), skk = sk); for (j=1, c/d-1, sk = concat(sk, skk)); if (isok(eval(sk)), listput(list, eval(sk))););););); list;}
    lista(nn) = {my(list = List()); forcomposite(c=1, nn, my(clist = Vec(listc(c))); for (k=1, #clist, listput(list, clist[k]));); vecsort(Vec(list),,8);}
    lista(8) \\ to get terms up to 8 digits

A349674 a(n) is the least v-palindrome in base n.

Original entry on oeis.org

175, 1280, 6, 288, 10, 731, 14, 93, 18, 135, 22, 63, 26, 291, 109, 581, 34, 144, 38, 24, 51, 1145, 46, 273, 50, 260, 335, 63, 58, 360, 62, 141, 110, 513, 224, 1404, 74, 140, 294, 189, 82, 224, 86, 344, 105, 2410, 94, 417, 98, 176, 497, 56, 106, 76, 60, 189, 1385, 3952, 100
Offset: 2

Views

Author

Michel Marcus, Nov 24 2021

Keywords

Comments

A v-palindrome in base n is a number k that is not palindromic in base n, but for which A338038(k) = A338038(reverse(k) in base n).

Examples

			a(10) = A338039(1) = 18.
		

Crossrefs

Programs

  • Mathematica
    s[1] = 0; s[n_] := Plus @@ First /@ (f = FactorInteger[n]) + Plus @@ Select[Last /@ f, # > 1 &]; a[b_] := Module[{k = b+1, r}, While[!(!Divisible[k, b] && k != (r = IntegerReverse[k,b]) && s[k] == s[IntegerReverse[k, b]]), k++]; k]; Array[a, 100, 2] (* Amiram Eldar, Nov 24 2021 *)
  • PARI
    f(n) = my(f=factor(n)); vecsum(f[, 1]) + sum(k=1, #f~, if (f[k, 2]!=1, f[k, 2])); \\ A338038
    isok(m, b) = my(r=fromdigits(Vecrev(digits(m, b)), b)); (m % b) && (m != r) && (f(r) == f(m));
    a(n) = my(k=1); while (!isok(k, n), k++); k;

A338371 Integers for which there exists a self-repetition that is a term of A338166.

Original entry on oeis.org

13, 17, 18, 19, 26, 31, 37, 39, 48, 49, 56, 62, 65, 71, 73, 79, 81, 84, 91, 93, 94, 97, 103
Offset: 1

Views

Author

Michel Marcus, Oct 23 2020

Keywords

Examples

			18 is a term since 1818 is a term of A338166.
48 is a term since 484848 is a term of A338166.
List of terms with their minimum number of repetitions : [13, 15], [17, 280], [18, 2], [19, 819], [26, 15], [31, 15], [37, 12], [39, 15], [48, 3], [49, 3243], [56, 3], [62, 15], [65, 3], [71, 280], [73, 12], [79, 624], [81, 2], [84, 3], [91, 819], [93, 15], [94, 3243], [97, 624], [103, 10234].
		

Crossrefs

Programs

  • PARI
    f(n) = my(f=factor(n)); vecsum(f[,1]) + sum(k=1, #f~, if (f[k,2]!=1, f[k,2])); \\ A338038
    period(vp,n) = {my(p = 1, pten = 10^#Str(n)); for (i=1, #vp, if ((vp[i] != 2) && (vp[i] != 5), p = lcm(p, znorder(Mod(pten, vp[i]))); p = lcm(p, znorder(Mod(pten, vp[i]^2))););); p;}
    isok(n) = {my(r = fromdigits(Vecrev(digits(n)))); my(vp = setunion(factor(n)[,1]~, factor(r)[,1]~)); my(nbmax = period(vp, n)); if (nbmax == 1, nbmax = 2); my(krep=1); my(pten = 10^#Str(n)); for (k=2, nbmax, krep = pten*krep+1; my(q=1); for (i=1, #vp, my(va = valuation(krep, vp[i])); q *= vp[i]^va;); if (f(n*q) == f(r*q), return(k);););}
    ispal(n) = my(d=Vecrev(digits(n))); n == fromdigits(d);
    lista(nn) = {for (n=1, nn, if ((n % 10) && !ispal(n), if (isok(n), print1(n, ", "));););}
Showing 1-6 of 6 results.