This site is supported by donations to The OEIS Foundation.

# User talk:M. F. Hasler

(Edit this sect.0)
**Welcome on my "discussion" page.**
Don't hesitate to leave me a message here, but to ensure I get it soon, you should send me an e-mail (for registered and authenticated users).
Please **sign (& date-stamp) your post using four tildas: ~~~~**, at the end of your message.

**Please have a look here: To-do lists - Category:To-do lists**and on "Reader's guide" just below.## Contents

## Reader's Guide

A small overview of what's here and elsewhere on this wiki. [Goal: complete and structured "table of contents" via which all (sic!) of my contributions to this wiki can be reached.]

- Edits that should be done in the main OEIS:
- /Huge records:
*(to be written)*. See To do on the OEIS for more.

- /Huge records:
- Suggested improvements in the server software: see User:M._F._Hasler/Work_in_progress/Improvements_of_OEIS
- Suggestions regarding the wiki:
- Mathematics. (Last not(?!) least !!!)

## Some contributions

I start an attempt to do some /writeup concerning investigations made on the occasion of my editorial work on OEIS.

Today, while checking a proposed contribution to A182040 (or A182092?), I created /A218556 and related sequences, concerning sequences like ...,100,101,110,112,...,998,100012,... (d distinct digits occurring with frequencies 1,2,3...). — M. F. Hasler 23:32, 2 November 2012 (UTC)

Today I added User:M._F._Hasler/Proposal for MainPage, following Talk:Main_Page. — M. F. Hasler 14:09, 4 February 2013 (UTC)

In 2008 I launched a (PB)wiki "Towards OEIS version Web 2.0" at http://oeis.pbworks.com/. On this wiki there are several suggestions that remain relevant for improvements of the OEIS web site & user interface. — MFH 14:46, 31 December 2014 (UTC)

A256229: Powering the decimal digits of n (right-associative). More natural variant of the existing left-associative version. Both dont differ from the power train (a^b*c^d*e^f...) before n=100. The left & right assoc. versions yield 1 if the first digit is 1 or any other digit is 0, so they can only differ from 211 on, and do differ for 212 (2^(1^2)=2 vs (2^1)^2=4). - MFH, Mar 19 2015

A256079: Increase each (decimal) digit of n by 1, with carry (i.e., '9' becomes '0' and a (further) increment of 1 of the digit to the left). Same as adding the repunit 1...1 of same length as n. The variant **without carry already exists as A048379 (base 10) and A035327 (base 2, converted back to base 10)**. Observed that this operation transforms A007931={1,2,11,12,21,22,111,...} into A032810={2, 3, 22, 23, 32, 33, 222} etc. [Make the list!] Added the variants A256078 (base 2, written as such), A256303 - A256308 for bases 3 through 8, A256289 for base 9, A256293-99 for the variants where the result is converted back to base 10. A.k.a. **Apply the transformation 0 -> 1 -> ... -> b-1 -> 0 to the digits of n.** - MFH, Mar 21 2015

Some work around A248218 = Period in residues modulo n in iteration of x^2 + 1 starting at 0. Added PARI code, and completed A248219 (= indices where this yields 1) with some other lists which should appear as A256342-A256349 (= moduli where this yields 2..9). - Mar 25 2015

Cf. A007088 (digits 0 & 1), A007931 (digits 1 & 2), A032810 (digits 2 & 3), A032834 (digits 3 & 4), A256290 (digits 4 & 5) - A256292 (digits 6 & 7), A256340 (digits 7 & 8), A256341 (digits 8 & 9). - Mar 27 2015

Integers (A256958 (-50,...); A001057, A000027, A001477): /Ranges n-k: A023443, ..., A023482 (k=2..40); k-n: A022958, ..., A022996. Wondering why up to k=40 was needed (without formulae and any crossrefs), but k=41..50 (including links, xrefs, programs, formulae) is not desired (insofar more as powers n^k are given up to k=50).... Also wonder in how far the links to "names of numbers" (excluding negative numbers) are relevant for these sequences whose sole interest lies in the presence of the negative terms... - Apr 18 2015.

...to be completed... Apr 29 ; Apr 30 ; May 01 ;

A257274 etc: numbers whose square is a sum of >= 3 consecutive triangular numbers. - May 02 2015.

A125373 and neighbours (members of large /Ranges!): They have a rational g.f. and are recurrent sequences. GF + link to /index/Rec#... should be added. Note, they seem to be first differences of sequences 6^n-5^n = A005062 etc. but this is only true for the first few membres! - MFH, May 03 2015

(...)

Stanley sequences : sets that avoid p-term arithmetic progressions: S=S_3, S_4, ..., and higher order constant differences (No 3-term AP: A005836 (>=0), A003278 (>0);
no 4-term AP: A240075 (>=0), A240555 (>0);
no 5-term AP: A020654 (>=0), A020655 (>0);
no 6-term AP: A020656 (>=0), A005838 (>0);
no 7-term AP: A020657 (>=0), A020658 (>0);
no 8-term AP: A020659 (>=0), A020660 (>0);
no 9-term AP: A020661 (>=0), A020662 (>0);
no 10-term AP: A020663 (>=0), A020664 (>0).
Cf. A240075 and A240555 ; A267300 and A267301 ; A267302 and A267303 for sequences avoiding 4-, 5-, 6-term subsequences with constant **second** differences;
A240556 and A240557 for sequences avoiding 5-term subsequences with constant **third** differences. (Started earlier this month. Today, added PARI code and index entries for Stanley sequences.) — MFH 04:37, 19 January 2016 (UTC)

A191017 - A191087 and some more outside that range were incorrectly named "primes that are (not) squares mod M" but actually equal to "Primes that have Kronecker symbol (p|M) = (-)1". — MFH 21:33, 18 January 2016 (UTC)

Added A269230 = indices for which A037053(n), the smallest prime with n digits '0', does not have n consecutive digits '0', and PARI code for these. — MFH 21:33, 18 February 2016 (UTC)

Added A269241 - A269250 = number of digits x in n^3, analog of A086008 - A086017 for squares. Linked to A048365^3 - A048374^3 = A036527 - A036536 = Smallest cube containing exactly n 0's,...,9's. Linked those to their analog for squares: A036507,...,A036516 = A048345^2,...,A048354^2. — MFH 02:27, 22 February 2016 (UTC)

(...) [Please update....]

A277830, ..., A277838 and A277849: Number of digits 'd' in the numbers from 0 to A014824(n) = sum_{i=1..n} i*10^(n-i) = (0, 1, 12, 123, 1234, 12345, ...): See /Digits d from 0 through 123...n. — MFH 13:59, 2 November 2016 (UTC)

## Categories

### ***NEW***

In reply to a mail from a fellow editor, Charles Greathouse, I developed the following idea:

To implement wiki-style, arbitrarily nested and user-editable categories on the main OEIS, it would be sufficient to allow for arbitrary keywords, which would, e.g., as soon as they start with an initial capitalized letter, represent categories. As such, these keywords should simply link to a search for "Category:Nnnn", which would display entries having either "Category:Nnnn" as name (listed first - this would represent the header of the actual "Category" page), or which have "Nnnn" as keyword: These would be the items -- sequences or (sub)categories -- filed under the given category.

Thus, a Category would be nothing else than a sequence having the special name "Category:Nnnn" and (a priori) no data (%S %T %U etc. lines) [unless this would be used internally for performance reasons, e.g., to record sequences linking to that category].

Thus, new categories itself, as well as their description, comments, links, references, and classification (within other (parent) categories) could be added and edited exactly in the same way as for sequences. **See further details on the dedicated (sub-)page /Categories. - Thanks!** — M. F. Hasler 08:32, 26 January 2012 (UTC)

- I have some thoughts on this idea; should I put them here, on User talk:M. F. Hasler/Categories, or somewhere else? Charles R Greathouse IV 19:41, 26 January 2012 (UTC)

- Yes, feel free to add it there, or wherever you like better/best, and add links, comments, or edits just as you like! — M. F. Hasler 12:54, 27 January 2012 (UTC)

## Random ideas about the OEIS wiki

I collect here some brainstorming / ideas about the wiki, please tell me if you think this should be shared with the community in a more public place. and/or know about a more appropriate place to put this material.

### "title" attribute in links to sequences

Links to sequences of the form A000000 should have the "title" popup (which displays their "NAME"=definition), as on the main site. Without this, index pages like http://oeis.org/Sindx_Pri.html are quite useless when there's a list of 20+ or 50+ or more xref's after one keyword. — M. F. Hasler 18:41, 3 October 2011 (UTC)

### Hard wired formatting vs macros/templates

- I think rather than to "hard code" formatting information in sequence pages

(oeis.org/wiki/Axxxxxx) on an individual basis, it would be much better to use macros(="templates") for this. This starts right with the sequence's title: rather than

' ' '< font size="+1" > ... < /font >' ' ' { { SeqHeader } }

it would be better to have the SeqHeader macro take the title as argument, and format it. (and even in that event, it would be much preferrable to use something like < h2 > instead of explicit '''...''' plus a < font > tag [ this is one of the oldest most depreciated tags, commonly referred to as "the dreaded font tag" ].)

The same should be done at least for all "fixed size" entries (keywords, offset, author, ...) which should go as arguments in such a macro. — M. F. Hasler 19:48, 3 January 2010 (UTC)

- It would be even better if we could use CSS stylesheets within the templates.
- — Daniel Forgues 17:20, 13 October 2010 (UTC)

- I agree: each of the standard sections should have a CSS class associated, which then can be used to tune the appearance globally (e.g. fixed font for "example" section; larger and/or different font, background, paragraph indentation and/or decoration for definition and terms of the sequence...); this could be implemented in the macro which formats that section (or the whole sequence).
- The main purpose of this should be the separation between content and formatting. The users should be able to edit the contents (as far as possible) without thinking/worrying about formatting issues, i.e. not even see any HTML code or wiki markup related to that, unless unavoidable (e.g. when creating diagrams or so). — M. F. Hasler 18:51, 13 October 2010 (UTC)

### Some minor problems that should be fixed

#### Spaces in PAGENAME / SeqHeader template

- The SeqHeader macro has a problem when spaces are in the page's name ; I agree that normally this should not happen, but I'm astonished that the PAGENAME variable's value is not 'urlencoded' (using '+' or %20 for spaces) -- what about other occurrences of this instance ? (args to templates or global variables with spaces). — M. F. Hasler 19:48, 3 January 2010 (UTC)

## Projects / TO DO on OEIS

Below some things that should or could be done on the OEIS "main site" -- i.e., this should concern mathematics or at least content of the oeis.org database, and not (only) the web pages, user interface, etc.

### Primes congruent to r mod m

I noticed a large chunk of sequences which should be listed in the index http://oeis.org/Sindx_Pri.html, section "Primes, in residue classes":

http://oeis.org/A141849 Primes congruent to 1 mod 11,..., http://oeis.org/A141857 Primes congruent to 10 mod 11. (hors série: A068228 Primes congruent to 1 (mod 12). A068231 Primes congruent to 11 (mod 12).) A141858 P = 2 mod 13. A141859 P = 12 mod 13. Various other combinations. http://oeis.org/A140444 Primes congruent to 1 mod 14. A141908 P = 2 mod 23. A141909 P = 4 mod 23.... A141926 Primes congruent to 22 mod 23. ... A142049 P = 1 mod 33,..., A142068 P = 32 mod 33. A142072 P = 19 mod 34. (...) A142292-A142311 P=1..43 mod 44. A142312-A1423xx P=1..44 mod 45. A1423xx-A1423xx P=1..45 mod 46. A1423xx-A142397 P=1..46 mod 47. A142398-A142413 P=1..47 mod 48. (16 seq: 0,2,3,4 mod 6 excluded) A142414-A142455 P=1..48 mod 49. (42 = 49-7 sequences: P=0 mod 7 excluded) A142466 P = 27 mod 50. (only 1 seq) A142476-A142507 P=1..50 (mod 51). (32 seq: P=0 mod 3 and P=0 mod 17 excluded.) A142508-A142531 P=1..51 (mod 52). (P in 2Z and P in 13Z excluded.) [http://oeis.org/search?q=Primes_congruent_to+mod_53 A142532 P = 2 mod 53, A142533 (=3 mod 53), ... ... A142889 P = 1 mod 63, ..., A142924 P = 62 mod 63. A142925 P = 1 mod 64, A142926 P = 3 mod 64, ... A142953 P=61 mod 64.

This seems to be the end of the "exhaustive" block. For larger primes, some sporadic follow:

http://oeis.org/A154621 Primes congruent to 32 mod 67. http://oeis.org/A154624 Primes congruent to 34 mod 71. http://oeis.org/A154628 Primes congruent to 35 mod 73.

Unified PARI code: return |N|-th prime = r (mod m) ; negative 3rd arg makes terms 1..|N| be printed out.

pc(r=2,m=23,N=-20)=forprime(p=1,default(primelimit),p%m-r&next;N-->0&next;N<0&!print1(p", ")&(N+=2)|return(p))

TO DO:

- complete the above ranges:
- check in which interval are there ALL possibilities listed
- check interrelations (e.g. some sequences = {initial term} union (sequence for 2m) - or similar. — M. F. Hasler 03:20, 25 November 2010 (UTC)

### periodic sequences of the form m^n mod p

Many sequences of the form "Period P : repeat (a,b,...,z)" are also of the form a(n)=m^n mod p (where mod = pmod in Maple syntax). I don't know if there are is an index for these, so I made one on my own: see /Periodic sequences of the form m^n mod p. — M. F. Hasler 18:35, 10 March 2011 (UTC)

## Other Messages/User talk

Here goes the real "User talk" which should be the main content of this page...

### Hope everything's alright

I moved in your write-up for the Sequence of the Day. Last you wrote on this website, the hurricane was downgraded. Hope everything's alright, or at least easily fixable, where you are at. Alonso del Arte 14:02, 3 November 2010 (UTC)

- Thanks a lot! indeed, due to some other problems, I forgot to do this tonight ... — M. F. Hasler 14:24, 3 November 2010 (UTC)
- You're welcome. I take it the other problems were not hurricane-related. Alonso del Arte 22:31, 3 November 2010 (UTC)

## Memoization

At first I thought "memoization" was a misspelling, but then I saw Charles use that term in his edit summary. Is memoization an actual thing or just a misspelling of "memorization"? Alonso del Arte 20:09, 12 March 2012 (UTC)

- I'm not Maximilian, but I can answer that. It's a real thing, the simplest form of dynamic programming. It involves storing values and recalling them later rather than re-generating the values. Some languages, like Maple and Mathematica, have nice syntactic features that allow memoization of values without explicitly writing out instructions on saving and restoring values. Charles R Greathouse IV 03:15, 13 March 2012 (UTC)

- Sorry for the late reply, but I assume you were able to find the answer quickly via http://google.com/search?q=memoization ... ;-) !
- And I confirm also the 2nd part of Charles' answer, regarding e.g. the "option remember" in Maple, and "table functions" (IIRC - should double check...) in Maxima, which unfortunately lacks in PARI and is a mess to implement by hand due to very poor handling of "sets" and strings, in particular when results have to be stored in a "sparse" manner (and not simply in a vector or table, in which case the only issue may be the dynamical re-allocation of a larger structure when needed. I have some code for this and may try to put it on a page. — M. F. Hasler 16:04, 25 March 2012 (UTC)
- I now added a wiki page (stub...) on Memoization. — M. F. Hasler 17:47, 25 March 2012 (UTC)

- Note that the treatment of sets is much better in recent versions of PARI (2.5.0+). Charles R Greathouse IV 20:41, 25 March 2012 (UTC)

## Open problem (Invitation):

Given an integer N>0, and after been found all the first N! terms of A217626, you were asked find either a function or algorithm which counts the number of different "trivial" palindromic patterns that could be built from these terms.

For example: [1,9,2,9,1] is a "trivial" palindromic pattern. But [2,18,4,18,2] is not trivial, until it is re-written it as: [2,2*9,4,9*2,2]

- By "trivial", do you seem to mean "primitive" in the sense of "not being a multiple of a primitive" one?,
*i.e.*, did you mean to write [2,18,4,18,2] = 2*A1 with A1=[1,9,2,9,1]? (using my "coding" detailed on /A217626)

- By "trivial", do you seem to mean "primitive" in the sense of "not being a multiple of a primitive" one?,

So the "triviality" of such kind of patterns depends on the prime factorization of their components. Such behavior can not be reproduced by the prime numbers.

- What is meant by "cannot be reproduced by the prime numbers"? (In what sense a number
this/something?)**(re)produces**

- What is meant by "cannot be reproduced by the prime numbers"? (In what sense a number

I can not spot it yet "the how", but the study of this matter might have deep implications in the number theory. (These patterns teach us how to build odd numbers in a similar way as what described by the Goldbach's Conjecture for the even numbers). If you decide to face this friendly challenge, Good Luck!!! Sincerely, with regards: R. J. Cano 18:56, 15 December 2012 (UTC)

## Main Page/Prototype

I've gone ahead and incorporated some of your ideas into Main Page/Prototype. I have not completely removed redundancies, however. Alonso del Arte 05:26, 18 February 2013 (UTC)

- Thanks! I have in turn, in my proposal User:M._F._Hasler/Proposal_for_MainPage, simplified the style attributes and added wiki code for subsection headings (for easier editing), and added "Seq in the news" and "recent additions" -- but what I strongly dislike, are the imposed(?) section headings the latter produce - is there a way to avoid that, and get only the contents? — M. F. Hasler 06:53, 18 February 2013 (UTC)

## Representing digits > 9

In several situations, for example when dealing with sequences that list permutations or numbers written in base-N, one has often the wish to be able to represent digits larger than 9. My essay * Representing large digits* provides a solution for this case:
One possibility of encoding digits d > 9, is to write them as (d-9k)*10^k for 9*k < d < 9*k+10, i.e., d=10 as "10", d=11 as "20",..., d=18 as "90", d=19 as "100", etc. Other variants which are more compact for larger digits are discussed on the page

*. — MFH 14:13, 5 October 2014 (UTC)*

**Representing large digits**